14250259ef
This PR attempts to get a syntect implementation that actually works, by manipulating the scope stack directly instead of trying to post-process the HTML. It takes strings like this: let _t = "interesting string \# boring string "; And produces DOMs that look like this: <span class="syn-source syn-rust"> <span class="syn-storage syn-type syn-rust">let</span> _t <span class="syn-keyword syn-operator syn-assignment syn-rust">=</span> <span class="syn-string syn-quoted syn-double syn-rust"> <span class="syn-punctuation syn-definition syn-string syn-begin syn-rust">"</span> interesting string </span> </span> <span class="boring"> <span class="syn-source syn-rust"> <span class="syn-string syn-quoted syn-double syn-rust">boring string</span> </span> </span> <span class="syn-source syn-rust"> <span class="syn-string syn-quoted syn-double syn-rust"> <span class="syn-punctuation syn-definition syn-string syn-end syn-rust">"</span> </span> <span class="syn-punctuation syn-terminator syn-rust">;</span> </span> In other words, it splits it up the same way a WYSIWYG editor might if you tried to apply a block style to a deeply-nested selection; it maintains the styles, but always ensures "boring" is top-level. It doesn't produce optimal HTML, but it should always work. |
||
---|---|---|
.. | ||
cli | ||
dummy_book | ||
summary_md_files | ||
alternative_backends.rs | ||
build_process.rs | ||
cli_tests.rs | ||
custom_preprocessors.rs | ||
init.rs | ||
parse_existing_summary_files.rs | ||
rendered_output.rs | ||
searchindex_fixture.json | ||
testing.rs |