pegdown icon indicating copy to clipboard operation
pegdown copied to clipboard

support <div mardown=1> ....?

Open basejump opened this issue 14 years ago • 6 comments

I did my best to fork and try to get this working but I got really lost in the peg. I spent quit a bit of time wrapping my head around the code. I got as far as understanding that we want to do something similar to how blockquotes work. but the push/pop combined with the location and how nodeSequence got me really wrapped into knots.

Any chance this is an easy fix or change for you? I will be watching the diff closely if so and hoepfully it will help me see the error of my ways

basejump avatar Mar 14 '12 16:03 basejump

What exactly is it that you want to achieve?

sirthias avatar Mar 14 '12 16:03 sirthias

The ability to render markdown inside of and html block. Both PHP Markdown Extra and MultiMarkdown support it. I had it working in my "dead" markdown-plus project using regex. Docs here http://michelf.com/projects/php-markdown/extra/#markdown-attr

Thanks for looking into this. I would be open to running with it if you can spare some time to do a screen share via skype and get me unstuck. I think the parboiled peg parser would be valuable to know but I am simply stuck on a number in a number of areas.

basejump avatar Mar 14 '12 17:03 basejump

Joshua,

I see. I think the easiest approach would be to collect the inner source of the marked HTML tag and then run a nested parser, similar to how list blocks are handled. Is that the approach you are taking?

Cheers,

Mathias

[email protected] http://www.parboiled.org

On 14.03.2012, at 18:03, Joshua Burnett wrote:

The ability to render markdown inside of and html block. Both PHP Markdown Extra and MultiMarkdown support it. I had it working in my "dead" markdown-plus project using regex. Docs here http://michelf.com/projects/php-markdown/extra/#markdown-attr

Thanks for looking into this. I would be open to running with it if you can spare some time to do a screen share via skype and get me unstuck. I think the parboiled peg parser would be valuable to know but I am simply stuck on a number in a number of areas.


Reply to this email directly or view it on GitHub: https://github.com/sirthias/pegdown/issues/49#issuecomment-4502660

sirthias avatar Mar 14 '12 17:03 sirthias

I was trying but I could never really get my head around it. I was using this as an example OneOrMore(AtxInline(), addAsChild()) and push(new BlockQuoteNode(withIndicesShifted(parseInternal(inner), (Integer)peek()).getChildren()))

I finally figured out how to get close to debugging to see what was being added and where the index was. The concept of pegs is just so different. Like regex, I know once it clicks it I can crank but it has not clicked yet. Do you have a trick to this? how to you keep track of where everything is?

I can check in my spaghetti if you think it will help but I was just throwing crap at the wall to see what would stick

basejump avatar Mar 14 '12 19:03 basejump

Joshua, I think inner HTML markdown support along the lines of <div mardown=1> is a valid feature request. I'll get to it with my next round of pegdown maintenance. Currently I'm somewhat swamped with other work, but it'll happen... Cheers, Mathias

sirthias avatar Mar 15 '12 09:03 sirthias

Just curious about this. I never could figure it out and get it working.

basejump avatar Oct 03 '13 17:10 basejump