diff --git a/core/modules/parsers/newwikitextparser/rules/entity.js b/core/modules/parsers/newwikitextparser/rules/entity.js new file mode 100644 index 000000000..3a1578a47 --- /dev/null +++ b/core/modules/parsers/newwikitextparser/rules/entity.js @@ -0,0 +1,26 @@ +/*\ +title: $:/core/modules/parsers/newwikitextparser/rules/entity.js +type: application/javascript +module-type: wikitextrule + +Wiki text run rule for HTML entities + +\*/ +(function(){ + +/*jslint node: true, browser: true */ +/*global $tw: false */ +"use strict"; + +exports.name = "entity"; + +exports.runParser = true; + +exports.regExpString = "&#?[a-zA-Z0-9]{2,8};"; + +exports.parse = function(match,isBlock) { + this.pos = match.index + match[0].length; + return [$tw.Tree.Entity(match[0])]; +}; + +})(); diff --git a/tw5.com/tiddlers/TestingNewWikiText.tid b/tw5.com/tiddlers/TestingNewWikiText.tid index 101116c01..50a01b1b0 100644 --- a/tw5.com/tiddlers/TestingNewWikiText.tid +++ b/tw5.com/tiddlers/TestingNewWikiText.tid @@ -17,7 +17,7 @@ And this will be {{{inline and monospaced}}} and `so will this` little bit. Here is some ''bold face'', and __some underlining__ and of course some --strikethrough--. -Here's an unterminated ''bit of bold face. +Here's an unterminated ''bit of bold face. And also some entities like Ç Ç "HTML Entity". Here is a macro <>