Skip to content

Source maps? #1022

Answered by wooorm
edemaine asked this question in Ideas
Discussion options

You must be logged in to vote

Do you really care about source maps, aka, objects like this? In that case, when we generate output (markdown, html, etc), we need to track, when outputting say <h2>, where that <h2> is, and where the ## were.

This is a) a bit complex, as mdast-util-to-markdown and hast-util-to-html generate deep first, the strings are then modified, and finally places somewhere, and it is b) not supported as far as I am aware: no browsers supports <!-- sourceMappingURL=... --> (as in, no browser supports reading the source map).

If you care about attaching data on HTML elements, like the markdown-it plugin you reference, then that is quite possible to accomplish with a few lines:

/**
 * @typedef {import(…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ChristianMurphy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
2 participants