SafeHTML

A provably safe HTML renderer.
Submit a document conforming to the grammar and it will be rendered securely.

Grammar
Doc     := <doc> EList </doc>
EList   := EList Element | Element | ε
Element := Img | Para | Table
Table   := <table> RList </table>
RList   := RList Row | Row | ε
Row     := <tr> CList </tr>
CList   := CList Cell | Cell | ε
Cell    := <td> EList </td>
Img     := <img Src />
Src     := src= Href
Href    := /static/1.png | /static/2.png | /static/3.png
Para    := <p> Text </p>
Text    := [a-zA-Z0-9]+
Document