Commit 2b51ba3a authored by Björn Peemöller 's avatar Björn Peemöller
Browse files

[HTML] Fixed bug in referencing entity definitions.

In HTML5, the link to an entity, which is given as the href attribute
of an anchor tag, may only contain unreserved characters (see RFC 3986).
All other characters have to be "percent"-encoded. However, this is not
true for the id attribute definining the target of the link, which may
contain arbitrary (non-whitespace) characters. In consequence, the name
of an entity (function/constructor) must be encoded for the link, but
must not be encoded for the definition.
parent 96e09135
......@@ -106,7 +106,7 @@ code2html m defs c
| isCall c = (defs, maybe tag (addHtmlLink m tag) (getQualIdent c))
| isDecl c = case getQualIdent c of
Just i | i `notElem` defs
-> (i:defs, spanTag (code2class c) (escIdent i) (escCode c))
-> (i:defs, spanTag (code2class c) (show $ unqualify i) (escCode c))
_ -> (defs, tag)
| otherwise = (defs, tag)
where tag = spanTag (code2class c) "" (escCode c)
......@@ -114,9 +114,6 @@ code2html m defs c
escCode :: Code -> String
escCode = htmlQuote . code2string
escIdent :: QualIdent -> String
escIdent = string2urlencoded . show . unqualify
spanTag :: String -> String -> String -> String
spanTag clV idV str
| null clV && null idV = str
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment