Paperbase Docs

PB_MARKDOWN_HTML_LEAKAGE

The Markdown input contained raw HTML that was passed through to the renderer.

Severityinfo
Categoryinput
Agent-repairableYes

What happened

The Markdown input contained raw HTML tags that were passed through to the renderer. Paperbase allows raw HTML in Markdown by default (which is usually desired — for embedding charts, custom layouts, etc.). This warning fires when the HTML appears unintentional, such as when LLM-generated Markdown accidentally includes literal <div> tags meant to be code samples.

How to fix

If the HTML is intentional, ignore this warning — raw HTML is a supported feature.

If the HTML is unintentional (e.g., LLM output that escaped code fences):

Option 1: Wrap HTML in code fences so it renders as a code block:

Here is a div:
 
```html
<div>content</div>

**Option 2:** Enable HTML sanitization:
```ts
const result = await paperbase.pdf.generate({
  input: { type: "markdown", content: md },
  template: "report",
  options: { sanitize_html: true }, // strips raw HTML from Markdown
});

Notes

sanitize_html: true strips all raw HTML from Markdown input. Use this when your content comes from untrusted sources or when you want to guarantee that only Markdown features are used.

On this page