diff --git a/.changeset/beige-starfishes-worry.md b/.changeset/beige-starfishes-worry.md
new file mode 100644
index 00000000..4feae9e2
--- /dev/null
+++ b/.changeset/beige-starfishes-worry.md
@@ -0,0 +1,5 @@
+---
+"preact-render-to-string": patch
+---
+
+avoid adding double colon for namespaced attributes
diff --git a/src/util.js b/src/util.js
index bc80ea48..397d01ad 100644
--- a/src/util.js
+++ b/src/util.js
@@ -1,6 +1,6 @@
export const VOID_ELEMENTS = /^(?:area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)$/;
export const UNSAFE_NAME = /[\s\n\\/='"\0<>]/;
-export const NAMESPACE_REPLACE_REGEX = /^(xlink|xmlns|xml)(:|[A-Z])/;
+export const NAMESPACE_REPLACE_REGEX = /^(xlink|xmlns|xml)([A-Z])/;
export const HTML_LOWER_CASE = /^accessK|^auto[A-Z]|^ch|^col|cont|cross|dateT|encT|form[A-Z]|frame|hrefL|inputM|maxL|minL|noV|playsI|readO|rowS|spellC|src[A-Z]|tabI|item[A-Z]/;
export const SVG_CAMEL_CASE = /^ac|^ali|arabic|basel|cap|clipPath$|clipRule$|color|dominant|enable|fill|flood|font|glyph[^R]|horiz|image|letter|lighting|marker[^WUH]|overline|panose|pointe|paint|rendering|shape|stop|strikethrough|stroke|text[^L]|transform|underline|unicode|units|^v[^i]|^w|^xH/;
diff --git a/test/render.test.js b/test/render.test.js
index e6b6fe1c..f8060d80 100644
--- a/test/render.test.js
+++ b/test/render.test.js
@@ -337,6 +337,12 @@ describe('render', () => {
``
);
});
+
+ it('should not add extra colon on SVG elements', () => {
+ let rendered = render();
+
+ expect(rendered).to.equal(``);
+ });
});
describe('Functional Components', () => {