Hi folks,
It seems, there is something in the TW core, that can mess up strings
inside <pre> elements.

some code basically does the following: It should insert "non
breakable space" in front of a "single character" line number if the
maximum number, that can be seen is 2 characters wide.

eg: put a \u00a0 (non breakable space) in front of "1", if the max
line number is "12".

pseudocode:

text = "1";
pad = "\u00a0";  // non breakable space

xx = pad + text;

xx is:  "&nbsp;1"

------------
The real code, is a bit more complicated.

-- info --
val = "1" ... line number
pad = "" ... empty string

minwidth = 2;

"firstNode.firstChild" is a text node "1" in the DOM
"pad" contains one or more "\u00a0" chars ...

the whole stuff is inside a <pre> element

-- real code [1] --
while (val.length + pad.length < minwidth) pad += "\u00a0";
if (pad) firstNode.insertBefore(
    targetDocument.createTextNode(pad),
    firstNode.firstChild);
-- --

creates: <pre>&amp;nbsp;1</pre>

======

If the codemirror library is used without TW stuff, there is no
problem. See link [2]
If you open codemirror.tiddlyspace HelloWorld [3] and enter "cmEdit"
mode you can see the problem

Some hints???
-m

[1] https://github.com/marijnh/CodeMirror2/blob/master/lib/codemirror.js#L947
[2] http://codemirror.net/mode/tiddlywiki/index.html
[3] http://codemirror.tiddlyspace.com/#HelloWorld

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/tiddlywikidev?hl=en.

Reply via email to