Description
This was reported by a Franklin user but ended up being a bug with the Markdown module:
julia> Markdown.parse("<一轮红日初升>")
ERROR: StringIndexError: invalid index [6], valid nearby indices [4]=>'轮', [7]=>'红'
This is because Markdown sees the < ... >
and tries to form an auto link and seems to be using string indexing in doing so. CommonMark.jl handles this well
julia> import CommonMark as CM
julia> p = CM.Parser()
julia> CM.html(p("<一轮红日初升>"))
"<p><一轮红日初升></p>\n"
actually reading the full stack trace points to _is_mailto
being the culprit
julia/stdlib/Markdown/src/Common/inline.jl
Lines 151 to 156 in bb5b98e
ironically there's a comment specifying that it's a bit risky to be slicing the string (also it's a bit odd to check the first 6 characters with a 7 character string)
A suggestion would be to replace
julia/stdlib/Markdown/src/Common/inline.jl
Lines 154 to 155 in bb5b98e
using first
and nextind
, I opened a PR with this here: #42140