fletcher / MultiMarkdown-5

Reference implementation of MultiMarkdown; replaces MultiMarkdown v4 (deprecated -- see MMD-6 instead)
https://github.com/fletcher/MultiMarkdown-6
Other
294 stars 46 forks source link

FIXED: don't remove / from labels #54

Closed thypon closed 7 years ago

thypon commented 7 years ago

this should handle cases where / is contained in labels

fletcher commented 7 years ago

Thanks for the submission, but a few questions/comments:

  1. What exactly are you trying to "fix"? There's nothing broken, per se. There's a reason why the range of characters that constitute labels is limited -- it has to meet criteria for HTML, LaTeX, ODF, and other possible future formats. Do you have a real-life example where this causes problems? Have you tested this in other output formats?

  2. I realize that the whitespace in the code is not always 100% consistent (my settings in Xcode aren't always customized, and sometimes that would create changes.) That said, a pull request with 64 lines of changes that really only changes a single line is difficult to check. It's much easier if the pull request only changes the minimum number of lines -- it took me several passes just to find the actual content of this request. It's fine for you to disagree with the existing whitespace, but leave it alone in this circumstance. ;)

  3. Last, but not least, check out this page. If you want to make your case for this change for MMD-6 over there, feel free. I'm open to considering changes. But this won't be changed in MMD-5 since a new version is almost finished.

thypon commented 7 years ago
  1. i'm trying to unbreak semantic labels in latex like when i use crossreferences as explained here https://en.wikibooks.org/wiki/LaTeX/Labels_and_Cross-referencing

This example:

## Something 1 [ch:som1]
### Something 2 [sub:som1/som2]

[](#sub:som1/som2)

is broken actually.

  1. Sorry for the whitespaces. My vim editor is configured to trim all of them on save https://github.com/thypon/dotconfig/blob/master/.vimrc#L82

  2. I know there will be another release in the near future but a stable working version isn't a bad idea for now.

fletcher commented 7 years ago
  1. It's not broken, you're doing it wrong. ;) You're confusing HTML anchors (the [](#foo) syntax) and MMD cross-references (the [][foo] syntax). The two are different things. Your example "accidentally" works correctly some of the time because you can generally anticipate what a heading id attribute will look like, but sometimes you can't. There are two ways to fix it. You can use a correctly anticipated HTML anchor:

    ## Something 1 [ch:som1]
    ### Something 2 [sub:som1/som2]
    
    [](#sub:som1som2)

    or you can use the expected MMD syntax (and it figures out the correct anchor for you):

    ## Something 1 [ch:som1]
    ### Something 2 [sub:som1/som2]
    
    [][sub:som1/som2]
  2. No worries.

  3. MMD 5 is a stable working version. ;) That's not to say it's 100% bug free, but it's very close for most users.