Open jzimpel opened 1 year ago
There has been no activity on this issue for the past year. We've marked it as stale and will close it in 30 days. We understand it may still be relevant, so if you're interested in the solution, leave a comment or reaction under this issue.
📋 Steps to reproduce
✔️ Expected result
The output of 'toData()' should contain the XML element with a camel cased tag name (the original case should be kept)
❌ Actual result
The output of 'toData()' contains the XML element with a tag name in lower case
❓ Possible solution
I managed to solve the problem by replacing the HTML document in the constructor of DomConverter with an XML document:
Original DomConverter source code:
Modified DomConverter source code:
The issue is caused by the usage of an HTML document, as the HTMLDocument.createElement() method converts all tag names to lowercase. See https://developer.mozilla.org/en-US/docs/Web/API/Document/createElement#tagname : "When called on an HTML document, createElement() converts tagName to lower case before creating the element." So, a default document should be used.
Maybe it would be possible to implement an option similar to the 'keepOriginalCase' option of DomConverter.domToView() , which when set true would cause the DomConverter to use a Document instead of an HTMLDocument.
💻 Version of CKEditor 37.1.0