Comments (3)
I just added support for CRLF-based line endings. See e6db7f9
Thanks for the idea.
from etree.
You could do something like this:
s := doc.WriteToString()
s2 := strings.NewReplacer("\n", "\r\n").Replace(s)
It would probably be better if etree natively supported CRLF line-endings in its WriteSettings
. I'll make a note of it and consider adding this soon.
from etree.
Yes, I did something similar, except that I first normalized the file to "\n" so I won't end up with spurious "\r\n" when the file has mixed mode line endings initially. You might want to consider that, too.
Thanks! :-)
func normalize(data string) string {
data = strings.Replace(data, "\r\n", "\n", -1)
data = strings.Replace(data, "\r", "\n", -1)
return data
}
from etree.
Related Issues (20)
- Can you share performance benchmarks or steps to measure it for this tool? HOT 2
- Perhaps link prominently to docs? HOT 1
- Add doctype read HOT 1
- a bug of Element.Text() HOT 1
- Error Read xml ISO-8859-1 HOT 1
- can not parse xml with "&" HOT 1
- Unexpected <></> when adding outer layer HOT 3
- Expected " but " HOT 1
- go version EOL HOT 1
- how to pretty print when writing back HOT 4
- xml writeto string? HOT 1
- UTF-8 support HOT 3
- Does this library supports XInclude standards for XML document? HOT 1
- How do I remove indent between inline labels? HOT 2
- Is there any way to get the comments of a document? HOT 5
- i don't wanna the string text to be escaped, how can i achieve that HOT 5
- if my text contains some string likes '<br>',but i dont wanna to escape them,how can i do HOT 2
- XPath string literal syntax does not accept double quotes HOT 2
- Avoid panics when element doesn't exist HOT 4
- vulnerabilities HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from etree.