You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Candle supports printing out information for multiple selectors (a {text}, link {text}, while Pup only prints information for one final selector. That makes printing out the JSON a bit weird, because then candle might print JSON mixed with text (e.g. a {json}, link {text}). Candle could let people do that, but it's very unlikely to be what people want. Let's enforce that {json} must be the final and only operator.
I think the JSON format should differ slightly from pup's in that it should always print out an array of objects, even if there's only one object.
Also maybe nice to have would be allowing it to filter to specific attributes, like div json{class}, which would print only the class for divs, and would not print the children at all. So given `
Like pup: https://github.com/EricChiang/pup#json
Candle supports printing out information for multiple selectors (
a {text}, link {text}
, while Pup only prints information for one final selector. That makes printing out the JSON a bit weird, because then candle might print JSON mixed with text (e.g.a {json}, link {text}
). Candle could let people do that, but it's very unlikely to be what people want. Let's enforce that{json}
must be the final and only operator.I think the JSON format should differ slightly from
pup
's in that it should always print out an array of objects, even if there's only one object.Also maybe nice to have would be allowing it to filter to specific attributes, like
:div json{class}
, which would print only theclass
fordiv
s, and would not print the children at all. So given `To support that, the selector should be
json{OPTIONAL_ATTRS}
, not{json}
, and thus{html}
should probably behtml{}
too, for consistency.The text was updated successfully, but these errors were encountered: