There's some discrepancy between the way Twine converts newlines for storage and the JS story engine converts it for use. I've been able to compose twine stories in a prototype browser based editor I've been working on. (simple text, nothing as cool as Twine 2). And noticed I wasn't having the same problems.
Checking the API, the function that unescapes slashes and newlines is.
unescapeLineBreaks
Passage.unescapeLineBreaks = function ( text )
checking the code in the engine. The script appears to do what it needs to.
Passage.unescapeLineBreaks=function(A){if(A&&A!=""){return A.replace(/\\n/mg,"\n").replace(/\\/mg,"\\").replace(/\r/mg,"")}else{return""}};
But no sign of the extra s.
- and I think I found it.. In Twine's tiddlywiki.py the python script that converts the story for storage.
Line 436
output = output.replace('\\', '\s')
So the question is what was the motivation behind '\s' instead of '\' ?
And what are the implications of "fixing" this line?
- Henry