HtmlFilters
Functions that take a Lexbor document and return a modified version
To create a Lexbor document, use Lexbor::Parser.new(html)
Class methods
downgrade_headers(doc, n = 2)
Shift headers so the highest level is n (n=2 means h1->h3, h2->h4, etc.) If n=2 and doc has h3 as the highest, then h3->h2, h4->h3, etc.
fix_code_classes(doc)
Post-process HTML to add language- prefix to code blocks
make_links_relative(doc, base)
Make all relative links absolute to the site root base is where the file containing the URIs is located relative to the site root
remove_empty_paragraphs(doc)
Remove empty paragraph tags