Fixed problem with custom CSS classes

This commit is contained in:
Jeremy Ruston 2011-12-08 13:04:12 +00:00
parent a09c43d456
commit be52fbb5d1
4 changed files with 6 additions and 7 deletions

View File

@ -636,7 +636,7 @@ WikiTextRules.rules = [
w.output.push(e);
var styles = WikiTextRules.inlineCssHelper(w);
if(styles.length === 0)
e.className = "marked";
WikiTextRules.setAttr(e,"className","marked");
else
WikiTextRules.applyCssHelper(e,styles);
w.subWikifyTerm(e.children,/(@@)/mg);
@ -647,9 +647,8 @@ WikiTextRules.rules = [
var lookaheadMatch = lookaheadRegExp.exec(w.source);
if(lookaheadMatch) {
w.nextMatch = lookaheadRegExp.lastIndex;
e = {type: lookaheadMatch[2] == "\n" ? "div" : "span", children: [
{type: "text", value: lookaheadMatch[1]}
]};
e = {type: lookaheadMatch[2] == "\n" ? "div" : "span", children: []};
WikiTextRules.setAttr(e,"className",lookaheadMatch[1]);
w.output.push(e);
w.subWikifyTerm(e.children,/(\}\}\})/mg);
}

View File

@ -1 +1 @@
<h2>Heading</h2>This is the second tiddler. It has a list:<br /><ul><li> Item one</li><li> Item two</li><li> Item three</li></ul>And a <macro></macro><br />
<h2>Heading</h2>This is the second tiddler. It has a list:<br /><ul><li> Item one</li><li> Item two</li><li> Item three</li></ul>And a <macro></macro> and a <span className="myClass">custom class</span><br />

View File

@ -5,4 +5,4 @@ This is the second tiddler. It has a list:
* Item one
* Item two
* Item three
And a <<macro invocation>>
And a <<macro invocation>> and a {{myClass{custom class}}}

View File

@ -1 +1 @@
HeadingThis is the second tiddler. It has a list: Item one Item two Item threeAnd a
HeadingThis is the second tiddler. It has a list: Item one Item two Item threeAnd a and a custom class