Skip to content
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

Identify type of Markdown item as part of AST? #125

Closed
gjtorikian opened this issue May 12, 2016 · 2 comments
Closed

Identify type of Markdown item as part of AST? #125

gjtorikian opened this issue May 12, 2016 · 2 comments

Comments

@gjtorikian
Copy link

I noticed that, given different types of lists, the AST renders the precise same way. (Example)

That is, given:

* word
* hey

- hey
- word

The AST lists

<list type="bullet" tight="true">

for both types of lists. I would hope that it had mentioned asterisk or dash or something.

@jgm Is there a reason for this? And if not, would you accept a contribution to fix that?

@jgm
Copy link
Member

jgm commented May 13, 2016

I'm not sure about this one. See the discussion at
http://talk.commonmark.org/t/preserve-bullet-char-in-ast/1108
It would be helpful if you'd comment there on the discussion
so far, and say a bit about why you'd like this feature.

+++ Garen Torikian [May 12 16 14:53 ]:

I noticed that, given different types of lists, the AST renders the
precise same way. ([1]Example)

That is, given:

  • word

  • hey

  • hey

  • word

    The AST lists

    for both types of lists. I would hope that it had mentioned asterisk or
    dash or something.

    [2]@jgm Is there a reason for this? And if not, would you accept a
    contribution to fix that?


    You are receiving this because you were mentioned.
    Reply to this email directly or [3]view it on GitHub

References

  1. http://spec.commonmark.org/dingus/?text=* word
    • hey

@jgm
Copy link
Member

jgm commented Jun 24, 2016

To do this, we'd need to extend the API with something like cmark_node_get_list_bullet or something like that.

Here's one potential issue I see: suppose we have an HTML -> CommonMark converter (I've written one of these using my lua bindings). If we add bullet types to the AST, then when we're building the AST to match the structure of the HTML document, we need to specify a bullet type of *, +, or - for each unordered list. But of course, there's nothing corresponding to that in HTML.

Perhaps this is just a minor inconvenience, since you could set this arbitrarily or leave it as its default value.

I'd be receptive to a PR to add this feature, if you need it in github.

CyberShadow pushed a commit to CyberShadow/cmark that referenced this issue Apr 1, 2021
This is not really a bug, but it's possible to send an input markdown
consisting of lots of @ signs, and the recursion will cause memory
explosion. The limit depends on the running environment, but there is no
reason to accept arbitrarily long sequence of @, so let's just cut off
at 1000.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants