pngwn / MDsveX

A markdown preprocessor for Svelte.
https://mdsvex.pngwn.io
MIT License
2.27k stars 96 forks source link

Passing CSS vars to inline components isn't supported in MDsveX files #459

Open AndrewLester opened 2 years ago

AndrewLester commented 2 years ago

Passing CSS vars to inline components isn't supported in MDsveX files. Example: Compiling this:

<script>
  import Chart from './Chart.svelte';
</script>

# Hello friends

Inline: <Chart --foo="bar" />

Yields this:

<script>
  import Chart from './Chart.svelte';
</script>

<h1>Hello friends</h1>
<p>Inline: <Chart —foo=“bar” /></p>

The issues are that the "--" is turned into an em-dash and the quotes around the CSS var value are smartified.

When the component isn't inline, it works properly.

pngwn commented 4 months ago

smartypants is doing this