Closed swyxio closed 4 years ago
Partly because of scope, partly because of the parser being annoying.
The component is converted into a Svelte component before being wrapped with the Layout
(if built-in layouts are used) which means the style tag is no longer a top-level element so it becomes a normal style tag rather than scoped css. This is solvable but annoying without reparsing the document since you just get a new string back from markdown-it
. The other reason was due to how markdown-it
parses style
elements since everything is configurable via the parser
option everything essentially has to work with standard markdown parsing rules (ish).
This is something I want to support and will look at fixing both issues when I implement #20 which will happen over the next few weeks, maybe sooner. Having an AST will make these kinds of modifications much simpler and won't require me to reparse the document which removes any significant performance penalty.
brilliant. i look foward to it
closing in favor of https://github.com/pngwn/MDsveX/issues/27
i've read https://github.com/pngwn/MDsveX/issues/10, so i understand that this may be hard given the current setup of mdsvex, but the way i really do want to code is to use mdsvex as a single file component file authoring mechanism.
while this thing is still in early life, i think its worth considering if this is what we want (i'm also throwing in github flavored markdown mixing of markdown and html tags):
this may mean forking rollup-plugin-svelte or integrating with it in some other way in order to be a superset.