Skip to content
Source
Sign inSign up
TanStack/markdown

Forward code fence meta to renderer #7

Send to my agent
Closedphuoccss(GitHub profile, opens in a new tab) opened this issue 1 comment

I have the following markdown content:

```js meta
console.log('hello world')
```-

I want to use meta to render different variations. I notice it's there in the document's node but it is not available to the renderer. Is there a way to achieve this other than writing an extension?

  1. tannerlinsley added labelsenhancement

  2. Confirmed on 0.0.14: the parser retains the raw info-string metadata in CodeBlockNode.meta, but the high-level framework components and highlighter callback do not receive it. This is a real API gap, not a parsing failure. The lower-level AST rendering APIs and HTML extension hook can already access it.

    I tested forwarding it as data-meta on pre across HTML, React SSR, and Octane SSR. The isolated candidate, including renderer simplification, still added 15 gzip bytes to the HTML entry, 4 to React, and 14 to Octane. It was not retained: the current acceptance rule is no growth against 0.0.14 in minified, gzip, or Brotli size, except for critical fixes.

    Keeping this open as an enhancement. A size-neutral implementation should preserve escaping, all three renderers, raw metadata, and the absence of an attribute when metadata is missing. No new option or attribute has shipped.

  3. tannerlinsley closed this

Sign in to join this conversation.