feat(board): render block-level markdown (headings + lists) in card text (t-mkd1) - #58
Open
ArgonQQ wants to merge 1 commit into
Open
feat(board): render block-level markdown (headings + lists) in card text (t-mkd1)#58ArgonQQ wants to merge 1 commit into
ArgonQQ wants to merge 1 commit into
Conversation
Rewrite mdToHtml as a line-oriented block pass: ATX headings #..###### -> <h1>..<h6>, unordered (- / *) and ordered (1.) runs -> <ul>/<ol>, other lines = paragraph text keeping the legacy soft-wrap (single newline = space, blank line = <br><br>). Extract a renderInline() helper (escape -> code split -> renderInlineMd) reused by headings, list items, and paragraphs so inline bold/italic/code/links work inside every block. Escape-first XSS invariant preserved: markers classified on raw text, all user text escaped before it reaches a tag. Applies to all three mdToHtml consumers (description, done/delivered detail, question text); the question-text container is switched from <span> to <div class=q-text> so block tags are valid HTML inside it. New heading/list CSS shared across .desc-rendered/.done-detail-text/.q-text, sized for cards. Webview-render-only; no parser/writer/store/grammar changes.
Contributor
|
📦 Build succeeded — installable loopboard-todo-mkd1-block-markdown.vsix Download from the run's Artifacts, unzip, then install: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Renders block-level markdown in story card text.
mdToHtml(media/board.js) is rewritten from an inline-only renderer into a line-oriented block pass:#..######→<h1>..<h6>-/*) runs →<ul>, ordered (1.) runs →<ol>(a marker-style switch ends one list and starts the other)\n= space, blank line =<br><br>, no<p>wrapper)A new
renderInline(text)helper (escape →`code`split →renderInlineMd) is reused by headings, list items, and paragraphs, so inline bold/italic/code/links keep working inside every block.Scope
Applies to all three
mdToHtmlconsumers (Rule: it's shared): card description, done/delivered detail, and question text. The question-text container is switched<span>→<div class="q-text">so emitting<hN>/<ul>/<ol>inside it is valid HTML. New heading/list CSS is shared across.desc-rendered/.done-detail-text/.q-text, sized down for compact cards.Webview-render-only — no parser/writer/store/grammar changes.
Safety (escape-first XSS invariant preserved)
The block classifier only inspects raw markers; every user-text fragment is
escapeHtml'd before it lands in a tag. Verified inert-escaping of<script>,- <img onerror=…>, and non-http(s)links stay non-linkified.Verification
make checkgreen (build + 103 Docker parser/writer fixpoint tests + package).media/board.jsis not in the Docker unit set, so I ran the new renderer in Docker node against 16 cases — headings, ul/ol, ul→ol split, inline-inside-block, para/list boundaries,<br><br>between paragraphs, soft-wrap, byte-for-byte parity with the legacy renderer on plain text, XSS (<script>,- <img onerror>),#nospacenot a heading,javascript:link not linkified — all pass.VERIFICATION.md) not run in this headless session — needs a human to eyeball the three consumers and confirm card-appropriate sizing.Closes t-mkd1.