Text reflow woes (or: I want bullets back!)y
solderpunk solderpunk at SDF.ORG
Sat Jan 18 17:23:01 GMT 2020
On Sat, Jan 18, 2020 at 05:41:05PM +0100, Julien Blanchard wrote:
> Both my clients try to display content as the author wrote it and I
> parse it line by line so I don't see any issue with the proposal as
> long as I can get the viewport size in my clients.
> Both NCurses and GTK should provide that I'm quite sure.
Okay, great!
> The ``` case will be a little bit more problematic as the parsing
> process would need to know what was parsed a few lines before
> (was a "tag" opened?).
By "was a tag opened?", do you just mean "am I currently inside or
outside a pair of ```s?". I have found this very easy to track, you
just need a single boolean variable, initialised to False at the start
of the document. Every time you see a ``` line you flip it's value.
When processing all other line types, the first thing you do is check
whether that value's true.
Cheers,
Solderpunk
Archive home | About this archive