Conversation
9eacd5c to
0bd5499
Compare
|
All fixed :) |
|
I like the idea but there can be implications on runtime, especially with very large files. On the one hand there is another allocation, on the other hand
But I will merge for now and wait for complaints later :-) Thank you for your contribution 👍 |
The regex runs per-line, so the impact will be limited. If you are worried about the allocation, I suppose it could be skipped if there are no matches. This regex specifically has a static prefix |
39845c0 to
0df2554
Compare
0df2554 to
02aa380
Compare
|
Seeing the potential for wrong output, how about we take a step back and write a custom HTML generator based on the one that's used? This avoids extra allocations and hacks like the double post-processing. |
|
Thanks for the suggestion. I had a look and the Markdown highlighter actually colors URL already. |
1602beb to
6f3e96b
Compare
| let link_highlighting = SyntaxDefinition::load_from_str( | ||
| include_str!("../assets/LinkHighlight.sublime-syntax"), false, None).expect("loading link style"); | ||
| let mut builder = syntax_set.into_builder(); | ||
| builder.add(link_highlighting); | ||
| let syntax_set = builder.build(); |
There was a problem hiding this comment.
This kills debug performance. We could use the trick from https://stackoverflow.com/questions/60751806/how-to-compile-some-dependencies-with-release but I don't know which dependency is the culprit.
There was a problem hiding this comment.
And it depends on yaml-rust which was promptly denied by CI :(
6f3e96b to
79717c2
Compare
cb5a690 to
6c7c60d
Compare
|
I piggy-backed on your idea in c8585a5. It's less intrusive because the bat/two-face syntax already marks the links in a way that can be recognized and I vendor bits of syntect code to output the links right away. I acknowledged your work in the |
Makes navigation easier. No need to copy and paste links to the address bar.