-
Notifications
You must be signed in to change notification settings - Fork 57
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
Convert selection XML to text (<> => <&>) #27
Comments
I tried with v. 3.0.4.3 and it works for me with &, though I would expect a slightly different behavior Expected behaviour: Function to de-/encode special chars within selected tags (which are not marked as CDATA): chars are replaced with ' " & < > and vice versa It also encodes tags though if selected, so I would expect it to encode only the content of a tag |
The de/encode is a simple text replacement algo. It has no notion of XML itself other than that it has to replace certain texts. Lets explore the use cases: Use case 1: Use case 2: I have some text node in XML that is encoded. Without using a full XML parser, I select this text and then run 'Convert selection text to XML. Now my selection is regular text and I can copy/paste it somewhere. Use case 3: Neither of these use cases require CDATA knowledge. Can you maybe describe your use case in detail? |
As described in a Python article dedicated to XML escaping [1], there are two separate cases to consider when escaping: CDATA and attributes. In the former case, there's no need to handle quotes; in the latter, quotes should be treated. It seems logical to have dedicated functions here for the two cases; or maybe be smart to check the context (but then it would be not very flexible for cases where context in not clear, as in a temporary file without proper XML structure used for intermediate work). Currently (in version 3.0.4.3) the function |
When i convert text to XML by using the
Convert selection XML to text (<> => <&>)
it seems to not do anything for the apostrophe (single quote) even if that should be'
The text was updated successfully, but these errors were encountered: