fletcher / MultiMarkdown-4

This project is now deprecated. Please use MultiMarkdown-6 instead!
https://github.com/fletcher/MultiMarkdown-5
Other
306 stars 59 forks source link

Location information in parse tree #67

Closed bjhomer closed 10 years ago

bjhomer commented 10 years ago

I see that the parser has a mk_pos_node function, along with mk_pos_str and mk_pos_list. It seems that these are designed to store the position information along with the node. However, these _pos_ functions do not actually store any position information right now. I'm considering using libMultiMarkdown in an app, and this position information would be very useful.

Is there a reason that the position information is not stored? Is simply a matter of it not yet being implemented yet. If I implemented this, would you be likely to accept it in a pull request? Are there any issues I need to be aware of while implementing it?

fletcher commented 10 years ago

Those were added early on when developing MMD-4 and I never changed them.

Subsequently, I did in fact write the code to do this for a separate project, MultiMarkdown Composer. That code is not open source, which is why it is not part of MultiMarkdown-4. At some point in the future, I may release that code, but not yet.

I can tell you that it was not easy to properly implement due to a combination of limitations of the greg parser, and the complexity of parsing that goes on when handling a Markdown/MultiMarkdown document. It seemed like it should have been much easier than it was.

If you want to discuss any further, feel free to email me!

F-