Skip to content

Commit 2355023

Browse files
committed
Fix hyperlink rendering in package description
The previous code rendered the contents of the hyperlink to a string of HTML before embedding it into the anchor element, which caused inner HTML elements to appear escaped in the final document. Embedding the contents directly without rendering them results in no escaping.
1 parent 8389c13 commit 2355023

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Distribution/Server/Pages/Package/HaddockHtml.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ htmlMarkup modResolv = Markup {
2727
markupOrderedList = ordList . map snd,
2828
markupDefList = defList,
2929
markupCodeBlock = pre,
30-
markupHyperlink = \(Hyperlink url mLabel) -> anchor ! [href url] << maybe url showHtmlFragment mLabel,
30+
markupHyperlink = \(Hyperlink url mLabel) -> anchor ! [href url] << fromMaybe (toHtml url) mLabel,
3131
markupAName = \aname -> namedAnchor aname << toHtml "",
3232
markupPic = \(Picture uri mtitle) -> image ! (src uri : maybe [] (return . title) mtitle),
3333
markupMathInline = \mathjax -> toHtml ("\\(" ++ mathjax ++ "\\)"),

0 commit comments

Comments
 (0)