Objective
If you insert a user's text into an HTML page without escaping it, that text can contain tags or scripts (XSS injection). html.escape converts dangerous characters into entities and html.unescape does the opposite.
Instructions
- The first line has the number
nof lines; each one isesc textorunesc text, with the text as the rest of the line. - For
escshow the escaped text inside a paragraph:<p>...</p>. Forunescshow the original text.
2
esc <b>hola</b>
unesc <i>
<p><b>hola</b></p>
<i>
Open the editor in full screen: the statement on the left and your code, the output and the tests on the right.
Start exercise