Add support for markdown script children#29
Conversation
queries for script elements with [markdown mimetype](https://tools.ietf.org/html/rfc7763) type attr dedents the inputs to authors can write pretty HTML
|
👋 Is this PR of interest? |
|
Hi! Thanks for the PR! Sorry about the delay - I just saw this =/ Could you tell me more about the whitespace issue (if we stick to |
|
With xmp tags, whitespace is preserved <html>
<body>
<main>
<article>
<details>
<summary>Show Code</summary>
<zero-md>
<xmp>
Whitespace was preserved :/
So these two lines are markdown blockquotesin this PR, script tags are dedented, so authors can write inline markdown without worrying about the initial indent <html>
<body>
<main>
<article>
<details>
<summary>Show Code</summary>
<zero-md>
<script type="text/markdown">
Whitespace was dedented :)
So this line is a markdown paragraph
And this line is a blockquoteBesides the whitespace, your README (and MDN) notes that XMP tags are deprecated. |
|
Thanks for the detailed explanation - this PR is definitely of interest. I generally agree that using I see that you have a Also, since |
|
Sure, So the dedent regex is adapted from various dedent implementations around the web. Maybe it's a little dark art (I've seen worse lol), but we're basically accumulating the "initial-whitespace-from-line-start" ( I'm not married to this particular implementation, but it has the advantage of being small and working. I haven't found an example of breaking input, but I haven't looked particularly hard 😉 WRT Maybe in the future browsers will decide to implement native support for |
|
Just checking in to see if this meets your approval |
|
I'll get it settled this weekend!! Sorry!! |
|
Merged! Thanks for your contribution! 👍 |
|
Outstanding. Thanks! |
(apologies for omitting description and title up till now)
This PR adds support for markdown script children in addition to XMP:
xmp template children will take precedence over script tags