

attribute value (with any operators and also quotes and case sensitivity modifiers) Html-to-text relies on parseley and selderee packages for selectors support.įollowing selectors can be used in any combinations:

For example, div#id is much better than #id - the former will only check divs for the id while the latter has to check every element in the DOM. But it is also important how you choose selectors. To achieve the best performance when checking each DOM element against provided selectors, they are compiled into a decision tree. Single best match is used instead (that is the last one of those with highest specificity). Unlike in CSS, values from different matched selectors are NOT merged at the convert stage.

User-defined entries are appended after predefined entries Įvery unique selector must have format value specified (at least once) The last selector is used when there are multiple matches of equal specificity Īll entries with the same selector value are merged (recursively) at the compile stage, in such way so the last defined properties a kept and the relative order of unique selectors is kept Highest specificity selector is used when there are multiple matches Selectors array is our loose approximation of a stylesheet. Base element(s) selection also got important changes.Ĭonst , Version 8 brings the selectors support to greatly increase the flexibility but that also changes some things introduced in version 6. Version 7 contains an important change for custom formatters. Version 6 contains a ton of changes, so it worth to take a look. Advanced converter that parses HTML and returns beautiful text.
