feediron / ttrss_plugin-feediron

Evolution of ttrss_plugin-af_feedmod
https://discourse.tt-rss.org/t/plugin-update-feediron-v1-2-0/2018
MIT License
206 stars 34 forks source link

[Bug correction] Reset basenode at each xpath rule #137

Closed GregThib closed 4 years ago

GregThib commented 4 years ago

When a xpath ruleset is made of several rules, and, for instance, the second rule return a void (because the underlying website as an optional HTML node for example), then the $basenode value will be filled with the node returned by the first rule of the set. So, to correct this and avoid repetitions into the result, the basenode=false have to be inside the rule's loop.

Bugfix/Enhancement

Example

Website: http://secouchermoinsbete.fr/ ATOM: https://secouchermoinsbete.fr/feeds.atom Rule:

    "secouchermoinsbete.fr": {
        "type": "xpath",
        "xpath": [
            "article[@class='anecdote']\/p[@class='summary']",
            "article[@class='anecdote']\/p[@class='details']",
            "div[@id='sources']"
        ],
        "join_element": "<br><br>"
    }
dugite-code commented 4 years ago

Good Catch, Thanks for your contribution