Issue with v1.5.0, tested in Chrome on Windows 10.
Create a docbook article, insert a code snippet with no language set and save the page. That works, but set a language for the snippet and you get an error on saving;
Document is invalid systemId: ....; lineNumber: 12; columnNumber: 38; attribute "class" not allowed here; expected attribute "annotations", "arch", "audience", "condition", "conformance", "dir", "language", "linkend", "os", "remap", "revision", "revisionflag", "role", "security", "userlevel", "vendor", "version", "wordsize", "xl:actuate", "xl:arcrole", "xl:href", "xl:role", "xl:show", "xl:title", "xl:type", "xml:base", "xml:id", "xml:lang" or "xreflabel"
You can also see the issue if you open an existing article that has a code snippet with a language set., Simply click save with no edits and the same thing occurs.
The code element and language attribute are translated to: <code class="language-bash"> and I think the problem is related to issue #229. One of its changes was to include the clause "[not(@class)]" in article-save.xsl:
This no longer makes sense as the class attribute is used within the template but the template is only applied if there is no class attribute. The snippet generated by the editor is not handled by this template and drops through to one intended for inline formatting.
The only solution for now is to remove the language settings of any snippets when you want to edit the file.
Issue with v1.5.0, tested in Chrome on Windows 10. Create a docbook article, insert a code snippet with no language set and save the page. That works, but set a language for the snippet and you get an error on saving;
Document is invalid systemId: ....; lineNumber: 12; columnNumber: 38; attribute "class" not allowed here; expected attribute "annotations", "arch", "audience", "condition", "conformance", "dir", "language", "linkend", "os", "remap", "revision", "revisionflag", "role", "security", "userlevel", "vendor", "version", "wordsize", "xl:actuate", "xl:arcrole", "xl:href", "xl:role", "xl:show", "xl:title", "xl:type", "xml:base", "xml:id", "xml:lang" or "xreflabel"
You can also see the issue if you open an existing article that has a code snippet with a language set., Simply click save with no edits and the same thing occurs.
The code element and language attribute are translated to:
<code class="language-bash">
and I think the problem is related to issue #229. One of its changes was to include the clause "[not(@class)]
" in article-save.xsl:This no longer makes sense as the class attribute is used within the template but the template is only applied if there is no class attribute. The snippet generated by the editor is not handled by this template and drops through to one intended for inline formatting.
The only solution for now is to remove the language settings of any snippets when you want to edit the file.