Skip to content

Unable to disambiguate emphasis delimiter #10

Closed

Description

@pcj

AST nodes do not provide start or end indices into the source and Emphasis.java and StrongEmphasis.java do not provide delimiter infomation. Therefore, for the input:

Hello *Italic* **Bold** _Emph_ __Strong__ ~~Strike~~!

It does not currently seem possible to parse this, build an AST, and emit the same markdown back out, as the metadata about the delimiter character is lost.

Activity

  1. robinst commented on Aug 10, 2015

    @robinst
    Collaborator

    It would be cool to have a CommonMark renderer (cmark has one too)! There's probably more issues related to that, so I've created #12 to track these.

    Would you be interested in contributing to this? This issue for example should be pretty simple to implement. Basically put the delimiter char on the node types (see EmphasisDelimiterProcessor).

    (Excuse my not being responsive by the way, I'm currently on holidays.)

  2. pcj commented on Aug 10, 2015

    @pcj
    ContributorAuthor

    I thought that opener.getLiteral().charAt(0) would be sufficient in EmphasisDelimiterProcessor. Sometimes the opener literal is null however. Surprised me.

  3. robinst commented on Aug 17, 2015

    @robinst
    Collaborator

    Yeah, that's a bit surprising. The reason is that the opener and closer nodes are truncated before calling the processor in InlineParserImpl. Maybe it would make sense to do this after calling the processor.

    In this case though, you can call getDelimiterChar() in EmphasisDelimiterProcessor to get the character.

  4. robinst commented on Feb 4, 2016

    @robinst
    Collaborator

    Fixed with #36.

  5. robinst commented on Apr 22, 2016

    @robinst
    Collaborator

    Released in 0.5.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions