-
Notifications
You must be signed in to change notification settings - Fork 320
content: Handle keyword highlighting in code blocks #1737
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
base: main
Are you sure you want to change the base?
content: Handle keyword highlighting in code blocks #1737
Conversation
The code block spans with `hll` (and `highlight` used for search keyword highlighting) classes can be nested inside other types of code block spans. So add support for parsing those types of spans.
Thanks! I see some timings, including for this PR, in #1707 (comment), which are very helpful. Can you repeat those timings atop main, without this PR's changes? Those show about 2ms for parsing a long code block. That's tolerable if we can't easily do better; but it's nontrivial, being a sizable fraction of a frame interval. So I'm curious how much of that is a regression due to what's added in this PR, and how much of it is already in our current logic. |
Here are the timings for main and this PR when running the release version of the app on my Android device running Lineage OS 22.2 (Android 15). Current main
Tree (this PR)
So looks like that the parsing step is faster with this PR, 1.4/1.8/2.3ms (min/avg/max) where on |
Great, thanks for checking that. So there's potentially room for improvement in our parse times for code blocks (as there might be for other content too) — but this PR moves that in the right direction. (And I think it's not currently a priority to try to optimize that parse time any further — it's tolerable that a giant message might take a couple of ms when it first appears.) |
Take 2 of #1707
Fixes: #1695
Screenshots when commits based on top of #1694: