-
Notifications
You must be signed in to change notification settings - Fork 0
escaping new lines and tabs #3
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
Conversation
var finalXmlString = xmlDocument.prettyPrinted | ||
|
||
finalXmlString = finalXmlString.replacingOccurrences(of: "&#", with: "&#") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var finalXmlString = xmlDocument.prettyPrinted | |
finalXmlString = finalXmlString.replacingOccurrences(of: "&#", with: "&#") | |
let xmlString = xmlDocument.prettyPrinted | |
.replacingOccurrences(of: "&#", with: "&#") |
//.replacingOccurrences(of: "%%", with: "%") | ||
//.replacingOccurrences(of: "«", with: "«") | ||
//.replacingOccurrences(of: "»", with: "»") | ||
//.replacingOccurrences(of: "á", with: "á") | ||
//.replacingOccurrences(of: "é", with: "é") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
//.replacingOccurrences(of: "%%", with: "%") | |
//.replacingOccurrences(of: "«", with: "«") | |
//.replacingOccurrences(of: "»", with: "»") | |
//.replacingOccurrences(of: "á", with: "á") | |
//.replacingOccurrences(of: "é", with: "é") |
let element = XMLElement(name: "string") | ||
let cleaned = Self.cleanupValueForAndroid(value) | ||
let textNode = XMLNode(kind: .text) | ||
textNode.stringValue = cleaned | ||
element.addChild(textNode) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why was this necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was my first approach. I had tried to prevent XMLElement from interpreting the string in any way and simply write what is in the source code of the .xcstrings directly (incl. ‘\n’ etc.) into the XML. Later I did the variant with the escaping and apparently forgot to remove the old code. At least I think that's how it was.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please undo the indentation changes and have a look at the comments
No description provided.