-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make links clickable #85
base: master
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And it depends on yaml-rust which was promptly denied by CI :(
6f3e96b
to
79717c2
Compare
Makes navigation easier. No need to copy and paste links to the address bar.