Skip to content

GFM underscore parsing is broken #491

Closed

Description

@javoire
To recap on_our_use_case

becomes
screen shot 2014-09-22 at 13 43 11

And it shouldn't, according to https://help.github.com/articles/github-flavored-markdown#multiple-underscores-in-words. The result should be the same as the input:

To recap on_our_use_case

Cheers,
JD

Activity

  1. javoire commented on Sep 22, 2014

    @javoire
    Author

    Also, this
    screen shot 2014-09-22 at 13 48 42
    becomes
    screen shot 2014-09-22 at 13 48 53

    Should be:

    variable_with_underscores = 1

    Fix hack (one back slash):
    screen shot 2014-09-22 at 13 56 33
    screen shot 2014-09-22 at 13 56 37

  2. javoire commented on Sep 22, 2014

    @javoire
    Author

    lastly:
    screen shot 2014-09-22 at 13 51 45
    becomes:
    screen shot 2014-09-22 at 13 52 01

    Fix hack (two backslashes):

    [http://example.com/link\\_with\\_underscore](http://example.com/link_with_underscore)
    

    cheers!

  3. javoire commented on Sep 22, 2014

    @javoire
    Author

    the behaviour is not consistent though. In some of our markdown files (with more code blocks and heavier markup) this behaviour is shown, and in others (usually lighter markup) it works as expected. I'll update here when I know more

  4. javoire commented on Sep 22, 2014

    @javoire
    Author

    Allright, I've finally narrowed a reproducable setup.
    So this:

    Lorem_ipsum dolor sit amet, __consectetur adipisicing__ elit. Voluptatem a __ea voluptas nihil__ error modi.
    Lorem_ipsum dolor sit amet, **consectetur adipisicing** elit. Voluptatem a **ea voluptas nihil** error modi.
    

    Should result in this:
    Lorem_ipsum dolor sit amet, consectetur adipisicing elit. Voluptatem a ea voluptas nihil error modi.
    Lorem_ipsum dolor sit amet, consectetur adipisicing elit. Voluptatem a ea voluptas nihil error modi.
    (e.g. identical, docs)

    But instead it results in this:
    screen shot 2014-09-22 at 19 49 23

    Reproduce steps

    1. input.md:
    Lorem_ipsum dolor sit amet, __consectetur adipisicing__ elit. Voluptatem a __ea voluptas nihil__ error modi.
    Lorem_ipsum dolor sit amet, **consectetur adipisicing** elit. Voluptatem a **ea voluptas nihil** error modi.
    1. run marked:
    marked -i input.md -o output.html
    1. output.html
    <p>Lorem<em>ipsum dolor sit amet, <strong>consectetur adipisicing</strong> elit. Voluptatem a <em>_ea voluptas nihil</em></em> error modi.</p>
    <p>Lorem_ipsum dolor sit amet, <strong>consectetur adipisicing</strong> elit. Voluptatem a <strong>ea voluptas nihil</strong> error modi.</p>

    Cheers

  5. javoire commented on Sep 22, 2014

    @javoire
    Author

    This one also produces wrong output:
    in

    Lorem_ipsum_dolor sit_amet, consectetur adipisicing elit. _[laborum rerum](laborum rerum)_
    

    out

    <p>Lorem<em>ipsum_dolor sit_amet, consectetur adipisicing elit. </em><a href="laborum rerum">laborum rerum</a>_</p>
    
  6. notatestuser commented on Sep 29, 2014

    @notatestuser

    I have one too:

    while this is correct

    $ marked
    {{some_test_thing}}
    <p>{{some_test_thing}}</p>

    this is not

    $ marked
    {{some_test_thing}} _another_ thing
    <p>{{some<em>test_thing}} _another</em> thing</p>
  7. Feder1co5oave commented on Jan 25, 2018

    @Feder1co5oave
    Contributor

    Can't reproduce this at 33b444c

    edit: I can reproduce this though.

    bin/marked 
    Lorem_ipsum_dolor sit_amet, consectetur adipisicing elit. _[laborum rerum](laborum rerum)_
    <p>Lorem_ipsum_dolor sit<em>amet, consectetur adipisicing elit. </em><a href="laborum rerum">laborum rerum</a>_</p>
    
  8. joshbruce commented on Apr 13, 2018

    @joshbruce
    Member

    Closing as I believe this will be fixed via spec-compliance. See #1106 and #1216

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions