mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-04-13 14:23:14 +00:00
Fixed problem with building TW under Windows
Fixes #717 The issue was that under Windows we generate text nodes that contained CRLF as a linebreak (rather than just LF as usual). The subtle problem is that when these strings are placed in the DOM via createTextNode(), the CR character is treated as a printable character, not whitespace. When creating DOM notes with innerHTML or as part of a static HTML document the HTML parser will strip out the CR characters. The hacky solution is to manually remove CRs before building the text node.
This commit is contained in:
parent
592cdc4617
commit
c8830d32f7
@ -30,8 +30,9 @@ TextNodeWidget.prototype.render = function(parent,nextSibling) {
|
||||
this.parentDomNode = parent;
|
||||
this.computeAttributes();
|
||||
this.execute();
|
||||
var text = this.getAttribute("text",this.parseTreeNode.text),
|
||||
textNode = this.document.createTextNode(text);
|
||||
var text = this.getAttribute("text",this.parseTreeNode.text);
|
||||
text = text.replace(/\r/mg,"");
|
||||
var textNode = this.document.createTextNode(text);
|
||||
parent.insertBefore(textNode,nextSibling);
|
||||
this.domNodes.push(textNode);
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user