Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR significantly improves SvelTeX's parsing of content mixing markdown and HTML syntax. Among other things, it includes the following changes:
Use
sanitize-html
to ensure that HTML generated by Markdownprocessor is valid.
Refine whitespace adjustment performed before passing markup to the
Markdown processor.
Remove
<p>
tags within HTML elements or Svelte components thatcannot contain paragraphs (e.g.,
<span><p>*text*</p></span>
becomes
<span><em>text</em></span>
now, ignoring insignificantwhitespace.
Add
markdown.components
option to SvelTeX configuration to specifypreferences in regards to how each Svelte component is treated by
SvelTeX when it comes to whitespace adjustments.
Auto-import components "registered" in the
markdown.components
arrayfrom the SvelTeX configuration if they are used in the markup and not
already imported in the file's
<script>
tag.Note: a component is "registered" in the
markdown.components
arrayiff there exists an object
obj
in themarkdown.components
array suchthat all of the following hold:
obj.name
equals the name of the component (case-sensitive).obj.importPath
is notundefined
.Add tests for all of the above features and fixes.
Add
markdown.remarkRehypeOptions
andmarkdown.rehypeStringifyOptions
to SvelTeX configuration when theunified
Markdown backend is used.Fixes #2.