Allow basic emoticons to work too.

This commit is contained in:
Robin Ward
2013-08-28 15:27:03 -04:00
parent af18cc87fd
commit eeef24b9da
6 changed files with 114 additions and 26 deletions
@@ -6,7 +6,7 @@
@param {function} emitter the function that creates JsonML for the tag
**/
function replaceBBCode(tag, emitter) {
Discourse.Dialect.inlineReplace({
Discourse.Dialect.inlineBetween({
start: "[" + tag + "]",
stop: "[/" + tag + "]",
emitter: emitter
@@ -21,7 +21,7 @@ function replaceBBCode(tag, emitter) {
@param {function} emitter the function that creates JsonML for the tag
**/
function replaceBBCodeParamsRaw(tag, emitter) {
Discourse.Dialect.inlineReplace({
Discourse.Dialect.inlineBetween({
start: "[" + tag + "=",
stop: "[/" + tag + "]",
rawContents: true,
@@ -59,21 +59,21 @@ replaceBBCode('li', function(contents) { return ['li'].concat(contents); });
replaceBBCode('spoiler', function(contents) { return ['span', {'class': 'spoiler'}].concat(contents); });
Discourse.Dialect.inlineReplace({
Discourse.Dialect.inlineBetween({
start: '[img]',
stop: '[/img]',
rawContents: true,
emitter: function(contents) { return ['img', {href: contents}]; }
});
Discourse.Dialect.inlineReplace({
Discourse.Dialect.inlineBetween({
start: '[email]',
stop: '[/email]',
rawContents: true,
emitter: function(contents) { return ['a', {href: "mailto:" + contents, 'data-bbcode': true}, contents]; }
});
Discourse.Dialect.inlineReplace({
Discourse.Dialect.inlineBetween({
start: '[url]',
stop: '[/url]',
rawContents: true,