Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to encode named entity references when saving ? #44

Open
ssire opened this issue Nov 7, 2013 · 0 comments
Open

How to encode named entity references when saving ? #44

ssire opened this issue Nov 7, 2013 · 0 comments

Comments

@ssire
Copy link
Owner

ssire commented Nov 7, 2013

Currently AXEL serialization of characters replaces the & ampersand with its XML named entity &. This is done by encodeEntites in defaultbrowser.js :

if (s.indexOf('&') != -1) {
  res = res.replace(/&(?![a-zA-Z]{3,5};)/g, '&'); // Avoid double encoding
}

However it avoids to convert it for named entities between 3 and 5 characters. The reasons are obscure, and why is it limited to entities between 3 and 5 characters ? Shouldn't it be limited only to XML named entities (amp, lt, gt, apos, quot) ?

For instance " is serialized as " which becomes " when loaded back into the editor which is serialized to " the second time !

At the same time &foobar; is serialized as &foobar; which is read as &foobar; and serialized back as &foobar;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant