ClickHouse / pastila

Paste toy-service on top of ClickHouse
https://pastila.nl/
Apache License 2.0
68 stars 6 forks source link

Highlight of selected text #11

Closed azat closed 2 years ago

azat commented 2 years ago

This pastebin service contains lots of logs (mostly ClickHouse), and it is useful to highlight selected text in the whole logs (query_id, logger name, function name).

This is simpler implementation of highlight-within-textarea without jQuery.

Note: this implementation is hackish enough, since I don't know either of CSS/HTML/JavaScript, but want this feature since I'm looking lots of logs in this pastebin

Refs: https://codersblock.com/blog/highlight-text-inside-a-textarea

alexey-milovidov commented 2 years ago

Very interesting.

I tried a similar approach for syntax highlighting: add highlighting while keeping all the accessibility properties of textarea (searchable, native copy-paste, zero added input lag, etc), and failed, because the textarea has a slightly different text wrapping behavior than pre-wrap.

alexey-milovidov commented 2 years ago

Let's try...

alexey-milovidov commented 2 years ago

https://codersblock.com/blog/highlight-text-inside-a-textarea

I have used exactly the same tutorial and it has failed.

alexey-milovidov commented 2 years ago

Ok, it is working.

alexey-milovidov commented 2 years ago

Sometimes it leads to a double vertical scroll bar (at least in Chromium). Please take a look: Screenshot_20220718_201210

alexey-milovidov commented 2 years ago

It is also extremely weird if I Ctrl+F in the browser: Screenshot_20220718_201928

Let's revert, because I prefer bug-free over features.