diff --git a/senfscons/SENFSCons.py b/senfscons/SENFSCons.py
index 628ebc40b00945f72636bc2e351363d8ece17acb..4c00d5a648badae9f6b142fc1fe3a3223cb0b508 100644
--- a/senfscons/SENFSCons.py
+++ b/senfscons/SENFSCons.py
@@ -466,7 +466,7 @@ def Doxygen(env, doxyfile = "Doxyfile", extra_sources = []):
                         "    mv $${html} $${html}.orig;" +
                         "    sed -e 's/id=\"current\"/class=\"current\"/' $${html}.orig" +
                         "        | tidy -ascii -q --wrap 0 --show-warnings no --fix-uri no " +
-                        "        | sed -e 's/name=\"\([^\"]*\)\" id=\"\\1\"/name=\"\\1\"/g'" +
+                        "        | sed -e 's/name=\"\([^\"]*\)\"\([^>]*\) id=\"\\1\"/name=\"\\1\"\\2/g'" +
                         "        | xsltproc --novalid --nonet --html --stringparam topdir %s -o $${html} %s -;"
                         "done; true")
                        % (htmlnode.dir.abspath, reltopdir, xslfile.abspath)))