Skip to content

Handle code spans per CommonMark - #93

Merged
littlefrontender merged 2 commits into
masterfrom
feat/89
Oct 6, 2026
Merged

littlefrontender merged 2 commits into
masterfrom
feat/89

Conversation

@littlefrontender

Copy link
Copy Markdown
Contributor

No description provided.

Add shared helpers in src/editor/codeSpan.ts and use them in both the
converter and StepField so backticks parse the way a standard Markdown
renderer does:

- Spans open and close with equal-length backtick runs, so ``a`b`` is
  the code "a`b"; an unmatched run stays literal text
- Inline code containing backticks is wrapped in a longer delimiter
  instead of escaped, since backslash escapes do not work inside code
- One-line ```code``` reads as an inline code span, not a code block
- Unescaping skips code regions, keeping backslashes literal there
Pasted Markdown is applied as the whole document, mimicking how
a host app loads content on startup rather than going through
the editor paste handler. Apply via button or Ctrl/Cmd+Enter.
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying blocks with  Cloudflare Pages  Cloudflare Pages

Latest commit: 261a5f8
Status: ✅  Deploy successful!
Preview URL: https://af438ffc.blocks-cno.pages.dev
Branch Preview URL: https://feat-89.blocks-cno.pages.dev

View logs

@littlefrontender
littlefrontender merged commit 6d2709b into master Oct 6, 2026
3 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