Use Pug to HTML
Render a safe Pug subset with JSON locals. Start with the sample, select the options and run the tool. Copy or download the result after reviewing it.
Behavior and limits
Render a safe Pug subset with JSON locals. Supports tags, attributes, escaped interpolation, array loops and conditions. Function calls, executable JavaScript, includes, extends, mixins and filters are rejected. Unescaped interpolation is still HTML-escaped. Preview scripts and external resources are blocked.
Example input
doctype html
html
body
h1 Hello #{user.name}
ul
each item in items
li= item
{"user":{"name":"Ada"},"items":["One","Two"]}
Expected behavior for the example
Produces a page with Hello Ada and two list items, One and Two.
Check important output in the application that will consume it. Use the tool directory to find related formats and tasks.
Frequently asked questions
How does Pug to HTML handle my input?
Render a safe Pug subset with JSON locals. Supports tags, attributes, escaped interpolation, array loops and conditions. Function calls, executable JavaScript, includes, extends, mixins and filters are rejected. Unescaped interpolation is still HTML-escaped. Preview scripts and external resources are blocked.
Is my input uploaded or saved automatically?
Processing runs locally in this browser. Input and results are not saved automatically. Downloads happen only when you choose them. The static preview blocks scripts and external resources when one is available.