-
-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AST in 1.0 #199
Comments
I do not. I want to move to using html-pipeline for any AST manipulation. However, I’d consider a PR that added the feature back in. Right now this gem uses https://github.com/kivikakk/comrak for Commonmark rendering, which supports walking the node tree. Also, if this rendering is unexpected, the bug should be filed over there. I am a bit surprised by it, though, as both this gem and that crate pass the Commonmark spec. I wonder if there is some unexpected whitespace in your text which is causing the |
The |
Wow, interestingly, while the HTML does not render the
I'm afraid I don't have time to dig into this but it seems to me that there is an inconsistency in the core CommonMark spec? |
Wow, looks like the paragraph is expected to check the parent node type. 😮 |
Yep. :/ This is to spec — see the definition of "loose" and "tight". Also, the original example at the top of this issue is off in more than one way; that's an ordered list ( |
That was my typo, sorry! I find it strange that the AST produces a paragraph node when the list is tight, but I can handle this in my renderer. |
Yepyep — I think it's to keep the CommonMark AST regular; rather than list items containing blocks or inlines, they only contain blocks, and then under some circumstances renderers can omit. HTML is the weirdo here, really. (I ran into a similar issue lately implementing Tiptap in a work project, where you can have your document schema have list items contain inlines or blocks, but not easily both. So I ended up having them always be blocks, and then adjusted the margin on |
Thanks everyone. @gjtorikian I’m going to have to use Markly for now, but I’ll keep an eye on developments here. comrak looks great, but I need the AST. html-pipeline looks really interesting too! I’ll be sure to check that out. |
Can you submit a bug report to https://github.com/ioquatix/markly :) We will fix it. |
@ioquatix Turns out it was by design and there is a way to handle it based on the loose predicate. |
I also needed to be able to manipulate an AST, so I reintroduced this feature: #276 Let me know if there are any operations you want to perform on a tree that isn't in that PR and I'll try to add it before releasing it. Otherwise I can do it whenever my open source schedule allows. |
Oh that's great to hear @gjtorikian! I’ll take a look. The most useful thing for me would be to have a double-dispatch visitor pattern like in Prism/SyntaxTree. That’s definitely something that could be implemented on the Ruby side and I’d be happy to work on that in a follow-up PR. |
Hey, I ran into an issue with the parser putting paragraph tags inside list items.
This
would produce this
I wondered if this might be fixed in the 1.0 pre-release but it looks like the option to parse to a document has been removed. Do you have plans to bring that back?
The text was updated successfully, but these errors were encountered: