module HtmlFilters

Overview

Functions that take a Lexbor document and return a modified version To create a Lexbor document, use Lexbor::Parser.new(html)

Defined in:

html_filters.cr

Class Method Summary

Class Method Detail

def self.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.


[View source]
def self.fix_code_classes(doc) #

Post-process HTML to add language- prefix to code blocks


[View source]
def self.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


[View source]