Replace special characters with their HTML equivalents

This commit is contained in:
Lovetocode999 2021-03-01 09:52:36 -07:00
parent f3dd296290
commit d53d80cb4b
1 changed files with 4 additions and 0 deletions

View File

@ -156,6 +156,10 @@ do
bullist=0 # Whether or not a bulleted list was just formed
}
{
# Replace special characters with their HTML equivalents
gsub(/</, "\\&lt;")
gsub(/>/, "\\&gt;")
gsub(/=&gt;/, "=>")
# If the line is ```, toggle preformatted text
if ($1 == "```") {
# The next four lines check if the previous line was part of a