diff --git a/lib/transform.mjs b/lib/transform.mjs
index 9f86076..4f8ec5a 100644
--- a/lib/transform.mjs
+++ b/lib/transform.mjs
@@ -4,6 +4,10 @@ import { fetchData, mime, toDataURL } from './utils.mjs';
/* eslint-disable no-param-reassign */
+function removeXML(string) {
+ return string.replace(/<\?xml.+\?>/, '');
+}
+
const modes = {
'img-base64': ({ node, diagramType, data, alt }) => {
node.type = 'paragraph';
@@ -31,7 +35,7 @@ const modes = {
node.type = 'html';
node.value = `
${data.toString()}
`;
+ }">${removeXML(data.toString())}`;
},
};
diff --git a/package.json b/package.json
index 65f4619..4661267 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "remark-kroki",
- "version": "0.2.11",
+ "version": "0.2.12",
"description": "Remark plugin for showing Kroki diagram",
"license": "MIT",
"author": {
diff --git a/test/snapshots/output.mjs.md b/test/snapshots/output.mjs.md
index 40a275d..96e4a3e 100644
--- a/test/snapshots/output.mjs.md
+++ b/test/snapshots/output.mjs.md
@@ -30,13 +30,13 @@ Generated by [AVA](https://avajs.dev).
[
{
type: 'html',
- value: '',
+ value: '',
},
]
> Snapshot 4
- ''
+ ''
## img-base64
diff --git a/test/snapshots/output.mjs.snap b/test/snapshots/output.mjs.snap
index b60a06f..7d478c5 100644
Binary files a/test/snapshots/output.mjs.snap and b/test/snapshots/output.mjs.snap differ