I am importing an xml message file in Django.
Part of this process requires me to convert escaped html characters to their html form using replace:
s = s.replace("<", "<")
My problem is that the xml file when viewed with vim contains a carriage return in the form "^ M". I would like to convert these carriage returns to break tags, but
s = s.replace("^M", "<br />")
doing nothing.
I tried to convert all these tags to an xml file using vim, but then my midim importer breaks.
Any idea on how I can perform this conversion using replace?
source
share