Skip to content

Commit

Permalink
GH-25: HTML 4 browsers don't support ' entity
Browse files Browse the repository at this point in the history
See https://stackoverflow.com/a/2083770 which refers to this spec:

  C.16. The Named Character Reference '
        https://www.w3.org/TR/xhtml1/#C_16

  The named character reference ' (the apostrophe, U+0027) was
  introduced in XML 1.0 but does not appear in HTML. Authors should
  therefore use ' instead of ' to work as expected in HTML
  4 user agents.
  • Loading branch information
sunaku committed Jul 25, 2018
1 parent 002fd4c commit 5be71a8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bin/dasht-query-html
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ trap 'exit 44' USR1 # exit with a nonzero status when no results found
function escape(xml) {
gsub("&", "\\&", xml)
gsub("\"", "\\"", xml)
gsub("\047", "\\'", xml)
gsub("\047", "\\'", xml) # https://www.w3.org/TR/xhtml1/#C_16
gsub("<", "\\&lt;", xml)
gsub(">", "\\&gt;", xml)
return xml
Expand Down
2 changes: 1 addition & 1 deletion bin/dasht-server-http
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ entities() {
echo "$*" |
sed -e 's/&/\&amp;/g' \
-e 's/"/\&quot;/g' \
-e "s/'/\&apos;/g" \
-e "s/'/\&#39;/g" \
-e 's/</\&lt;/g' \
-e 's/>/\&gt;/g'
}
Expand Down

0 comments on commit 5be71a8

Please sign in to comment.