Skip to content

Commit

Permalink
refactor(Mermaid): add container
Browse files Browse the repository at this point in the history
  • Loading branch information
whiteformed committed Jan 30, 2025
1 parent 570e82d commit dddf36f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/plugin/transform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,14 @@ export function transform(options: Partial<PluginOptions> = {}) {
const token = tokens[idx];
const code = encodeURIComponent(token.content.trimStart());

return `<div class="mermaid" data-content="${code}"></div>`;
const containerClassName = 'marmaid-container';

return [
`<div class="${containerClassName}">`,
`<div class="mermaid" data-content="${code}">`,
'</div>',
'</div>',
].join('');
};
};

Expand Down

0 comments on commit dddf36f

Please sign in to comment.