4 ms·
> I wanted to switch over to a parser-based implementation, but at the time all the existing parsers were setup to emit HTML, so getting character-offsets out o
by xentronium 15y ago
> I wanted to switch over to a parser-based implementation, but at the time all the existing parsers were setup to emit HTML, so getting character-offsets out of the parser wasn't possible without hacking the parser to death.
You might want to try libupskirt [1], library github uses.
[1] http://fossil.instinctive.eu/libupskirt/index http://fossil.instinctive.eu/libupskirt/index
- bodhi 15y agoCool, thanks. I haven't looked deeply into it, but from a quick glance it seems to want to transform the input. For my use case I need a parse tree, with specific byte (well, character really) offsets. For example, I need to know where the link started, not that there is now a a link with text T and href H. My program (and Macchiato I assume) doesn't actually transform the source to an output format, we add attributes to the source text (similar to RTF).