Skip to content
Agentmart
Submit a tool

confluence-html

Create rich, interactive HTML that survives Confluence's save sanitizer by using only inline styles, no external resources, and JavaScript for dynamic content.

Skill by yiliu30

IndexedMIT★ 2
Write a review

Chalk Labs

Need help deploying confluence-html?

Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.

Book a call

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/yiliu30-confluence-html

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Create rich, interactive HTML that survives Confluence's save sanitizer by using only inline styles, no external resources, and JavaScript for dynamic content. Use this skill when embedding HTML visualizations, interactive diagrams, or data displays into Confluence pages via the HTML macro. The main challenge is that Confluence strips CSS `<style>` blocks and `class=` attributes on save (though preview shows them). This skill ensures your HTML builds and stays beautiful after save.

Use cases: frontend, data, ml, writing

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/confluence-html

What's inside

Skill name
confluence-html
Description
Create rich, interactive HTML that survives Confluence's save sanitizer by using only inline styles, no external resources, and JavaScript for dynamic content. Use this skill when embedding HTML visualizations, interactive diagrams, or data displays into Confluence pages via the HTML macro. The main challenge is that Confluence strips CSS `<style>` blocks and `class=` attributes on save (though preview shows them). This skill ensures your HTML builds and stays beautiful after save.
License
MIT
Instructions
141 lines in SKILL.md · view on GitHub

Files (1)

  • SKILL.md

SKILL.md (first lines)

# Confluence HTML Macro

You are creating HTML that will be embedded into Confluence via the `<ac:structured-macro ac:name="html">` macro. The challenge: **Confluence preview renders correctly, but on save the sanitizer strips `<style>` blocks and `class=` attributes, breaking the layout.**

The solution is counterintuitive — build like it's 2005: all styling via inline `style=""` attributes, no external resources, and JavaScript to apply dynamic styles.

## How Confluence's HTML Sanitizer Works

Preview is misleading. When you save:
- **Strips entirely**: `<style>` blocks, `<link>` tags, `@import`, external fonts
- **Strips attributes**: `class=`, all CSS custom properties (`var(--xxx)`)
- **Removes from DOM**: `<head>` (only `<body>` renders)
- **Blocks CSP**: external CDNs, Google Fonts, analytics
- **Preserves**: `<script>` blocks, inline `style=""` attributes, `style.*` from JS

This means your beautiful CSS architecture gets nuked on save, leaving only raw HTML and inline styles.

## Instructions

### 1. Ban All CSS Classes and Style Blocks

- Delete the `<style>` block entirely
- Remove all `class="xxx"` attributes
- Rewrite every styling decision as inline `style="property: value;"`

```html
<!-- ✗ DON'T: relies on .card class from <style> block -->
<div class="card">Content</div>

<!-- ✓ DO: inline everything -->
<div style="background: #fff; border: 1px solid #ccc; padding: 1rem; border-radius: 8px;">
  Content
</div>
```

### 2. Use Only System Fonts

No web font loading. Use:
- `'Courier New', monospace` (system mono)
- `Georgia, serif` (system serif)
- `Arial, -apple-system, sans-serif` (system sans)

```css
/* ✗ DON'T */
font-family: 'JetBrains Mono';
@import url('https://fonts.googleapis.com/...');

/* ✓ DO */
font-family: 'Courier New', monospace;
```

### 3. Use JavaScript for Dynamic Styles

JavaScript `<script>` blocks survive. Apply all dynamic styling via `element.style.*`:

```html
<!-- Apply responsive layout -->
<div id="grid"></div>
<script>
const grid = document.getElementById('grid');
grid.style.display = 'grid';
grid.style.gridTemplateColumns = 'repeat(32, 1fr)';
grid.style.gap = '1px';
grid.style.background = 'rgba(100, 100, 100, 0.1)';
</script>
```

### 4. Inline Hover Effects

CSS `:hover` requires a `<style>` block. Use `onmouseenter` / `onmouseleave`:

```html
<div id="box" style="background: #eee; padding: 1rem;"
  onmouseenter="this.style.background='#ddd'; this.style.transform='scale(1.02)'"
  onmouseleave="this.style.background='#eee'; this.style.transform='scale(1)'">
  Hover me
</div>
```

### 5. Flatten All Color References

Never use CSS custom properties (`var(--color)`). Use `#hex` or `rgba()` directly:

```html
<!-- ✗ DON'T -->
<span style="color: var(--primary-color);">Text</span>

<!-- ✓ DO -->
<span style="color: #0e8a7d;">Text</span>
```

### 6. Wrap in Confluence HTML Macro

```html
<ac:structured-macro ac:macro-id="unique-id" ac:name="html" ac:schema-version="1">
  <ac:plain-text-body><![CDATA[
<!-- your inline-styled HTML here -->
]]></ac:plain-text-body>
</ac:structured-macro>
```

## Examples

### Input
User wants to embed an interactive data grid visualization in Confluence showing token cache layout with custom colors.

### Expected Behavior

Before embedding — the local HTML renders beautifully with light mode colors, gradients, and a 64×32 grid of cells.

Steps:
1. **Audit the HTML**: search for `class="`, `<style>`, `<link>`, `var(--`. All must return 0 matches.
2. **Convert classes to inline**: For each `.grid-cell { background: ...; }`, add `style="background: ..."` to the element.
3. **Move CSS custom properties**: Replace `color: var(--primary)` → `color: #hex`
4. **Port animations/responsive logic to JS**: Move `@keyframes`, `@media`, `:hover` into `<script>` blocks using `element.style.*`.
5. **Test preview**: Open Confluence, paste via HTML macro, verify preview renders.
6. **Test save**: Save the page, reload. If layout persists, it's Confluence-safe.

## What NOT to Do

From yiliu30/z2h, MIT.

More from yiliu30/z2h

Signals

Stars
2
Forks
0
Open issues
1
Last commit (this folder)
May 22, 2026 (5 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from yiliu30

Done for you

Rather not set it up yourself?

Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.

See how we build AI agents →Read the case studies

Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.

launches shipped
50+
launches shipped
media placements
500+
media placements
founders on every account
2
founders on every account

Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block

Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.

Get confluence-html running in your business

Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.

Goes to the Chalk Labs founders, not the newsletter. Privacy

Need help deploying confluence-html?

CallGet help
Cite this page

confluence-html skill. Agent Mart. https://agentmart.dev/skills/yiliu30-confluence-html (last updated 2026-10-24)