2012-06-05 14:00:55 +00:00
|
|
|
/*\
|
|
|
|
title: $:/core/modules/parsers/newwikitextparser/rules/entity.js
|
|
|
|
type: application/javascript
|
|
|
|
module-type: wikitextrule
|
|
|
|
|
2012-06-05 21:54:36 +00:00
|
|
|
Wiki text run rule for HTML entities. For example:
|
|
|
|
|
|
|
|
{{{
|
|
|
|
This is a copyright symbol: ©
|
|
|
|
}}}
|
2012-06-05 14:00:55 +00:00
|
|
|
|
|
|
|
\*/
|
|
|
|
(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])];
|
|
|
|
};
|
|
|
|
|
|
|
|
})();
|