bgamari / trac-to-remarkup

Moved to GitLab: https://gitlab.haskell.org/bgamari/trac-to-remarkup
https://gitlab.haskell.org
BSD 3-Clause "New" or "Revised" License
2 stars 0 forks source link

Square brackets indiscriminately interpreted as link #31

Closed tdammers closed 5 years ago

tdammers commented 5 years ago

As reported by Ryan Scott on ghc-devs:

There appears to be some impedance mismatches between GitLab's formatting and Trac's formatting in certain places. For example, see the bottom of this issue [1], which has a long, hyperlinked line with the phrase:

IcanproducethemissinginstanceissuewithouthavingtorecompileGHC,whichiswhyIthinkitmightbeindependentofthisbug.

[1] https://gitlab.staging.haskell.org/ghc/ghc/issues/16211

tdammers commented 5 years ago

This isn't actually supposed to be a link in the first place - if you look at the original Trac ticket, you can clearly see that the intention is to just put those two sentences between square brackets, and Trac renders that correctly. Our parser, however, sees the square bracket and goes "AHA! That's a link!", and makes it into a (nonsensical) link: it takes the first word ("This" / "Note") and interprets it as a link target into the git repository, and the remaining words as some sort of label.

tdammers commented 5 years ago

OK, so there was some code in place to handle this already, but it needed to be wrapped in a larger try to avoid crashing the parser hard on non-link square brackets.

bgamari commented 5 years ago

I suspect @tdammers was referring to 7f83d287a3365327f666132cc7a9b7be583fc380 in his reference to "some code in place to handle this already". Indeed I should have left a reference to this ticket in the commit message.

@tdammers, perhaps the try inside shorthandLink should be removed?

tdammers commented 5 years ago

@tdammers, perhaps the try inside shorthandLink should be removed?

Of course. Done!