Weird things in docs (markdown & Documenter)

Hi, I’m seeing strange things in the html created by Documenter as compared with the original markdown and which involve the use of _. See the bellow examples.

This is from (nevermind link address, it’s an alias from Github) https://www.generic-mapping-tools.org/GMT.jl/latest/coast/ and respects the option C. Notice that it shows river_fill, riverfill and riverlakes

But theoriginal in Markdown is always with the underscores.

So the issue is why sometimes the underscores are respected but others they just disappear? I suspect it can be something related to underscores being interpreted as Latex but then it still should behave always the same.

Use code quoting for code snippets, `code`.

Anyway, I am guessing https://github.com/JuliaLang/julia/pull/25564 is what is causing it.

But that PR was merged in January and I’m using Julia 1.1.1 so it should be in already.
(I did enclose the variables under pairs of ``. The other text comes from two images)

Yes, my point is that it might be causing it. Since it interprets underscores in a special way and the problem is with underscores.

Ah, I see.

I have a similar issue. I have read that the backslash \ should be able to mask the letter _, but this does not work for me inside function documentation block :frowning:

The following example crashes the compilation of my module that includes my function that would like to document (Julia v1.7.2):

@doc """
filename = "foo\_a\_b.txt"
"""

The error message is:

ERROR: LoadError: syntax: invalid escape sequence

You need to escape the \ if you want to use it in a string literal:

julia> Markdown.parse("foo_a_b.txt")
  fooab.txt

julia> Markdown.parse("foo\_a\_b.txt")
ERROR: syntax: invalid escape sequence
Stacktrace:
 [1] top-level scope
   @ none:1

julia> Markdown.parse("foo\\_a\\_b.txt")
  foo_a_b.txt
1 Like