Skip to content

Add @{}, @[], @<> in-document tag syntax #5

Merged
brainbuz merged 2 commits into
mainfrom
brainbuz
Apr 17, 2026
Merged

Add @{}, @[], @<> in-document tag syntax #5
brainbuz merged 2 commits into
mainfrom
brainbuz

Conversation

@brainbuz

Copy link
Copy Markdown
Owner

Add @{}, @[], @<> in-document tag syntax with TagProcessor

Implement a two-phase TagProcessor (preprocess/postprocess) that
intercepts @{}, @[], and @<> directives in the document body before
Kramdown sees them, replacing them with HTML comment placeholders that
are substituted back after Markdown rendering.

@{} applies CSS classes, IDs, and data-* attributes as

(block/
section) or (inline); supports explicit and next-word-only
closure.
@[] introduces semantic HTML5 block elements (aside, section, figure,
etc.) in single-block and section forms with @[/element] close.
@<> introduces inline HTML elements (u, mark, abbr, etc.) with the
same explicit/next-word closure rules as @{} inline.
@ escape sequence passes a literal @ through; !! delegates to
Markdown's own ! escape.

Wired into render_html.rb. 30 tests. Spec sections 8.1–8.5 added,
section 6.1 style recommendations added. default.dml updated.

Implement a two-phase TagProcessor (preprocess/postprocess) that
intercepts @{}, @[], and @<> directives in the document body before
Kramdown sees them, replacing them with HTML comment placeholders that
are substituted back after Markdown rendering.

@{}  applies CSS classes, IDs, and data-* attributes as <div> (block/
     section) or <span> (inline); supports explicit and next-word-only
     closure.
@[]  introduces semantic HTML5 block elements (aside, section, figure,
     etc.) in single-block and section forms with @[/element] close.
@<>  introduces inline HTML elements (u, mark, abbr, etc.) with the
     same explicit/next-word closure rules as @{} inline.
\@   escape sequence passes a literal @ through; \!! delegates to
     Markdown's own \! escape.
@brainbuz brainbuz merged commit 0cb7a39 into main Apr 17, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant