Commit c783897d authored by Andrew Gibiansky's avatar Andrew Gibiansky Committed by GitHub

Merge pull request #677 from leftaroundabout/bug/escape-anglebrackets

Escape html control characters in error messages.
parents a57cb83c b0a328a1
......@@ -1313,14 +1313,17 @@ formatErrorWithClass :: String -> ErrMsg -> String
formatErrorWithClass cls =
printf "<span class='%s'>%s</span>" cls .
replace "\n" "<br/>" .
fixDollarSigns .
replace "<" "&lt;" .
replace ">" "&gt;" .
replace "&" "&amp;" .
replace useDashV "" .
replace "Ghci" "IHaskell" .
replace "‘interactive:" "‘" .
fixDollarSigns .
rstrip .
typeCleaner
where
fixDollarSigns = replace "$" "<span>$</span>"
fixDollarSigns = replace "$" "<span>&dollar;</span>"
useDashV = "\nUse -v to see a list of the files searched for."
isShowError err =
"No instance for (Show" `isPrefixOf` err &&
......
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