Re:Show HN: My WWDC-inspired project. A Markdown editor for ...
by xentronium on Monday August 08, 2011 @07:52AM
(#2859708)
> 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.
Re:Show HN: My WWDC-inspired project. A Markdown editor for ...
by bodhi on Tuesday August 09, 2011 @06:32AM
(#2863528)
Cool, 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).
I tried to implement my version of this idea[1] with regular expressions too, using OgreKit. I ran into all sorts of problems with corner cases, especially with nesting of block-level elements (lists/blockquotes/code). 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.
There's been some good discussion on the Markdown list[2] recently about these sorts of things, a really interesting example is PEG Markdown Highlight[3], which is exactly what I wanted to do with my app, but I was too busy (read: lazy) to get around to.
[1]: http://keshiki.net/markdown-editor/
[2]: http://six.pairlist.net/mailman/listinfo/markdown-discuss
[3]: Project: http://hasseg.org/peg-markdown-highlight/ Discussion: http://six.pairlist.net/pipermail/markdown-discuss/2011-June...