You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
offer a utility for preprocessing that kinda works like this:
import{utils}from"svelte/compiler"(asyncfunction(){constresult=awaitsvelte.preprocess(file,{markup: ({ content })=>{code=utils.modifyTemplate(template=>{// no need to mess with stripping and restitching style and script tagsreturnpug.render(template)})return{ code };},});})();
we offer this for script and style tags, it feels weird that we don't offer it for markup right?
Describe alternatives you've considered
do nothing, or
could also just consider an alternative template api:
The text was updated successfully, but these errors were encountered:
swyxio
changed the title
add markup preprocessor helper util that only works on markdown
[idea] add markup preprocessor helper util that only works on markdown
Jun 11, 2020
swyxio
changed the title
[idea] add markup preprocessor helper util that only works on markdown
[idea] add markup preprocessor helper util that only works on markup
Jun 11, 2020
The reason for this is that script and style tags are markup. That said, they are also handled specially by Svelte. If you were writing pug, wouldn’t you write your script and styles tags in pug syntax too?
mm i see! pug doesnt officially mention either way what their script and style tag support is. probably pug isn't the best example here anyway... what are other ways that the markup preprocessor gets used?
honestly dont really know any others but the level of interest in my talk seemed to indicate that people had ideas.
this isnt something im dying to have i just thought it might be nice to have since we offer that to the <style> and <script> tags. but now that you explained it this way im not gonna insist on it
Is your feature request related to a problem? Please describe.
while writing the preprocessor recipe (https://github.com/svelte-society/recipes-mvp/blob/master/build-setup.md#how-to-make-a-pre-processor-that-makes-it-possible-to-use-pugjade) and livecoding for a talk, i realized it is too hard to split out the script/style tags and then too easy to forget to stitch them back together again. this is a pretty common task for markup preprocessing and i think it would be very low cost to add it to svelte since it only involves optional code?
Describe the solution you'd like
offer a utility for preprocessing that kinda works like this:
we offer this for script and style tags, it feels weird that we don't offer it for markup right?
Describe alternatives you've considered
do nothing, or
could also just consider an alternative
template
api:How important is this feature to you?
nice to have
The text was updated successfully, but these errors were encountered: