mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-01-11 18:00:26 +00:00
Cleaning up WikiTextRules
This commit is contained in:
parent
0f3cf24642
commit
4bed00220e
@ -44,17 +44,12 @@ textPrimitives.tiddlerAnyLinkRegExp = new RegExp("("+ textPrimitives.wikiLink +
|
|||||||
textPrimitives.brackettedLink + ")|(?:" +
|
textPrimitives.brackettedLink + ")|(?:" +
|
||||||
textPrimitives.urlPattern + ")","mg");
|
textPrimitives.urlPattern + ")","mg");
|
||||||
|
|
||||||
var createElementAndWikify = function(w) {
|
// Helper to add an attribute to an HTML node
|
||||||
var e = {type: this.element, children: []};
|
var setAttr = function(node,attr,value) {
|
||||||
w.output.push(e);
|
if(!node.attributes) {
|
||||||
w.subWikifyTerm(e.children,this.termRegExp);
|
node.attributes = {};
|
||||||
};
|
|
||||||
|
|
||||||
var setAttr = function(e,attr,value) {
|
|
||||||
if(!e.attributes) {
|
|
||||||
e.attributes = {};
|
|
||||||
}
|
}
|
||||||
e.attributes[attr] = value;
|
node.attributes[attr] = value;
|
||||||
};
|
};
|
||||||
|
|
||||||
var inlineCssHelper = function(w) {
|
var inlineCssHelper = function(w) {
|
||||||
@ -353,7 +348,11 @@ var rules = [
|
|||||||
match: "^<<<\\n",
|
match: "^<<<\\n",
|
||||||
termRegExp: /(^<<<(\n|$))/mg,
|
termRegExp: /(^<<<(\n|$))/mg,
|
||||||
element: "blockquote",
|
element: "blockquote",
|
||||||
handler: createElementAndWikify
|
handler: function(w) {
|
||||||
|
var e = {type: this.element, children: []};
|
||||||
|
w.output.push(e);
|
||||||
|
w.subWikifyTerm(e.children,this.termRegExp);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user