CRDoc::Render::Inline
Inline Markdown parsing and word wrapping.
Class methods
Parses inline Markdown into styled pieces. Links keep their text, images keep their alt text, and HTML tags disappear.
Cuts pieces to limit characters, ending with … when it cuts.
Decodes only the entities that doc comments use for markup characters.
Full HTML5 decoding would turn &block into a block character.
Splits pieces into unbreakable words. Code spans never split.
wrap(words : Array(Array(Piece)), io : IO, context : Context, first_prefix : String, rest_prefix : String, base : Style = Style::Plain, lead_style : Style = Style::Plain) : Nil
Writes words wrapped to the context width. The first line starts with first_prefix (styled lead_style) and later lines with rest_prefix. Plain pieces take base style.