diff --git a/CHANGELOG.md b/CHANGELOG.md index 993fea9..ce8a8cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ Below are the changes we have made in this release. - Add option for exposing DOM for embedded properties (#208) - Add srcset support (#209) - Add language support (#210) +- Add option for filtering root class names (#211) - Add option for metaformats support (#213) ### Changes diff --git a/README.md b/README.md index 884935d..e754370 100644 --- a/README.md +++ b/README.md @@ -91,6 +91,11 @@ Use `expose_dom=True` to expose the DOM of embedded properties. Use `metaformats=True` to include any [metaformats](https://microformats.org/wiki/metaformats) found. +### `filter_roots` + +Use `filter_roots=True` to filter known conflicting user names (e.g. Tailwind). +Otherwise provide a custom list to filter instead. + ## Advanced Usage `parse` is a convenience function for `Parser`. More sophisticated behaviors are diff --git a/mf2py/parser.py b/mf2py/parser.py index 1ff8057..9529005 100644 --- a/mf2py/parser.py +++ b/mf2py/parser.py @@ -42,6 +42,8 @@ def parse( expose_dom (boolean): optional, expose the DOM of embedded properties. metaformats (boolean): whether to include metaformats extracted from OGP and Twitter card data: https://microformats.org/wiki/metaformats + filter_roots (boolean or list): optional, filter root class names. Use + True to filter known conflicting classes, otherwise filter given list. Return: a json dict represented the structured data in this document. """ @@ -72,6 +74,8 @@ class Parser(object): expose_dom (boolean): optional, expose the DOM of embedded properties. metaformats (boolean): whether to include metaformats extracted from OGP and Twitter card data: https://microformats.org/wiki/metaformats + filter_roots (boolean or list): optional, filter root class names. Use + True to filter known conflicting classes, otherwise filter given list. Attributes: useragent (string): the User-Agent string for the Parser