module

Hwaro::Content::Processors::TableParser

Constants

TABLE_SEPARATOR_CHECK = /^\s*\|?\s*:?-{3,}:?\s*\|/m

Quick check if content might contain tables. Detects the separator row pattern which is the definitive marker of a markdown table (e.g. |---|---| or ---|---). This avoids false positives from random | in code blocks, URLs, or inline code while still catching tables with or without leading/trailing pipes.

Instance methods

has_table?(content : String) : Bool
Source
process(content : String, *, math : Bool = false, flags : InlineMarkdown::Flags | Nil = nil, hooks : RenderHooks::HookRenderContext | Nil = nil) : String

Process markdown content and convert tables to HTML Tables are converted to HTML placeholders, then markd processes the rest, and placeholders are replaced with actual HTML tables. math: true keeps $…$ spans in cells untransformed for the later math pass. flags (when given) takes precedence over math and also threads the F10 inline markup flags (ins/mark/sub/sup) into cell rendering. hooks routes each table through the render-table hook (see Table#to_html); nil keeps the stock output.

Source

Nested types