Custom highlighting

I want to make a clone of Obsidian and I basically wanted a mix of the text_editor and markdown components: a text editor that allows displaying titles, bold, (eventually) lists, etc.

I’m new to rust so I don’t know if I’m just approaching this the wrong way, but I don’t see how I can implement my own Highlighter, and then how can I pass it to the text_editor - if I’m not mistaken, it only takes the settings for the inbuilt Highlighter, is that so?

I tried calling highlight_with with my own to_format function, but I’m unable to instantiate a Format due to visibility, is this feasible?

My apologies in advance, I’m very new to Rust, but I really liked the Elm-style architecture of this library.

Hello Did you ever make anny headway on this?

You could check out my GitHub repo, pml68/iced_custom_highlighter

Documentation can only be found in the fix branch, since that’s what actually works right now.

In case this helps anyone here is an example. I was able to make a custom highlighter using iced 0.13.1 nadi-system/nadi-ide/src/editor/my_hl.rs at main · Nadi-System/nadi-system · GitHub

The code is a tiny bit complex due to my language having multiline strings, and iced has highlight per line mechanism. But if your syntax doesn’t have components that expand to multiple lines, it should be easy enough.