Class: LLM::Console::Markdown::Parser
- Inherits:
-
Kramdown::Parser::Kramdown
- Object
- Kramdown::Parser::Kramdown
- LLM::Console::Markdown::Parser
- Defined in:
- lib/llm/console/markdown/parser.rb
Overview
Treats HTML and smart punctuation as plain text. Keep each parser registered (so kramdown's sub-parser lists, eg tables, still resolve) but point it at a no-op that emits the matched text literally instead of parsing it.
Tables are enabled but only match when a header row is followed by a delimiter row (---). This breaks from default kramdown behavior which parses |foo| as a table.
Constant Summary collapse
- LITERAL =
Swap these parser slots for literal-text no-ops.
%i[span_html block_html smart_quotes typographic_syms]
- TABLE_START =
A table starts with a header row that holds a pipe and a delimiter row (
---). A lone|foo|in prose is not a table, so this matches only when a delimiter follows. /^[ \t]*(?=\S)#{TABLE_LINE}(?=#{TABLE_SEP_LINE})/m