= {
a: ['href', 'title', 'target', 'rel'],
img: ['src', 'alt', 'title', 'width', 'height'],
source: ['src', 'srcset', 'type', 'media'],
+ button: ['class', 'title', 'type', 'aria-label', 'data-copy'],
th: ['colspan', 'rowspan', 'align'],
td: ['colspan', 'rowspan', 'align'],
h3: ['id', 'data-level', 'align'],
@@ -306,7 +308,15 @@ export async function renderReadmeHtml(
// Syntax highlighting for code blocks (uses shared highlighter)
renderer.code = ({ text, lang }: Tokens.Code) => {
- return highlightCodeSync(shiki, text, lang || 'text')
+ const html = highlightCodeSync(shiki, text, lang || 'text')
+ // Add copy button
+ return `
+
+${html}
+
`
}
// Resolve image URLs (with GitHub blob → raw conversion)