GeopJr / Tuba

Browse the Fediverse
https://tuba.geopjr.dev/
GNU General Public License v3.0
545 stars 59 forks source link

[Request]: composer syntax highlighting #153

Closed GeopJr closed 6 months ago

GeopJr commented 1 year ago

Describe the request

see: #137

Implementation Details

nekohayo commented 1 year ago

In case this is helpful, you might want to take a look at GTG's code for handling highlighting of tags in semi-realtime (it waits a fraction of a second to parse stuff for performance reasons because we have a lot of costly operations happening in the backend and data format otherwise)

GeopJr commented 1 year ago

Thanks for the info!

I'll take a closer look but I had mostly (ab)using gtksourceview's syntax highlighting in mind. Instead of parsing the input and highlighting manually, we could write a custom lang file that handles @ # : and perhaps some markdown with asterisks, blockquotes, backticks, lists. Unsure if it's possible as I haven't looked further into it but I assume it will be more perfomant and safe than regex (considering the amount of rules)