haskell / haddock

Haskell Documentation Tool
www.haskell.org/haddock/
BSD 2-Clause "Simplified" License
361 stars 241 forks source link

Can't escape the "markdown" link syntax in code #1422

Open mastarija opened 3 years ago

mastarija commented 3 years ago

I have this documentation code:

@'passIf' [AgeUnder] (>18)@

Haddoc interprets the [AgeUnder] (> 18) as a markdown link and renders it as AgeUnder that links to > 18. If I try to escape [] then it renders with \ like this \[AgeUnder\] (> 18).

sjakobi commented 3 years ago

As a workaround, you can put the code into a "bird tracks" block:

> passIf [AgeUnder] (>1>)

The lack of markup support in bird tracks means that you can't hyperlink the passIf identifier though. See https://haskell-haddock.readthedocs.io/en/latest/markup.html#code-blocks.