Merge branch 'release/0.5.0.0-RC' into develop
This commit is contained in:
commit
8e2103e69b
2 changed files with 12 additions and 9 deletions
|
|
@ -12,35 +12,35 @@
|
||||||
});
|
});
|
||||||
|
|
||||||
var inlinePlugin = window.markdownitForInline;
|
var inlinePlugin = window.markdownitForInline;
|
||||||
md.use(inlinePlugin, 'utf8_symbols', 'text', function (tokens, idx) {
|
md.use(inlinePlugin, "utf8_symbols", "text", function (tokens, idx) {
|
||||||
tokens[idx].content = tokens[idx].content.replace(/<->/g, "↔")
|
tokens[idx].content = tokens[idx].content.replace(/<->/g, "↔")
|
||||||
.replace(/<-/g, "←")
|
.replace(/<-/g, "←")
|
||||||
.replace(/->/g, "→")
|
.replace(/->/g, "→")
|
||||||
.replace(/<3/g, "♥");
|
.replace(/<3/g, "♥");
|
||||||
});
|
});
|
||||||
|
|
||||||
md.use(inlinePlugin, 'link_new_window_and_missing_http', 'link_open', function (tokens, idx) {
|
md.use(inlinePlugin, "link_new_window_and_missing_http", "link_open", function (tokens, idx) {
|
||||||
tokens[idx].attrs.forEach(function(attribute, index, array) {
|
tokens[idx].attrs.forEach(function(attribute, index, array) {
|
||||||
if( attribute[0] === 'href' ) {
|
if( attribute[0] === "href" ) {
|
||||||
array[index][1] = attribute[1].replace(/^www\./, "http://www.");
|
array[index][1] = attribute[1].replace(/^www\./, "http://www.");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
tokens[idx].attrPush([ 'target', "_blank" ]);
|
tokens[idx].attrPush([ "target", "_blank" ]);
|
||||||
});
|
});
|
||||||
|
|
||||||
var hashtagPlugin = window.markdownitHashtag;
|
var hashtagPlugin = window.markdownitHashtag;
|
||||||
md.use(hashtagPlugin, {
|
md.use(hashtagPlugin, {
|
||||||
// compare tag_text_regexp in app/models/acts_as_taggable_on-tag.rb
|
// compare tag_text_regexp in app/models/acts_as_taggable_on-tag.rb
|
||||||
hashtagRegExp: '[' + PosixBracketExpressions.alnum + '_\\-]+|<3',
|
hashtagRegExp: "[" + PosixBracketExpressions.alnum + "_\\-]+|<3",
|
||||||
// compare tag_strings in lib/diaspora/taggabe.rb
|
// compare tag_strings in lib/diaspora/taggabe.rb
|
||||||
preceding: '^|\\s'
|
preceding: "^|\\s"
|
||||||
});
|
});
|
||||||
|
|
||||||
var mentionPlugin = window.markdownitDiasporaMention;
|
var mentionPlugin = window.markdownitDiasporaMention;
|
||||||
md.use(mentionPlugin, {
|
md.use(mentionPlugin, {
|
||||||
mentions: mentions,
|
mentions: mentions,
|
||||||
allowHovercards: true,
|
allowHovercards: true,
|
||||||
currentUserId: app.currentUser.get('guid')
|
currentUserId: app.currentUser.get("guid")
|
||||||
});
|
});
|
||||||
|
|
||||||
var subPlugin = window.markdownitSub;
|
var subPlugin = window.markdownitSub;
|
||||||
|
|
@ -51,11 +51,13 @@
|
||||||
md.use(sanitizerPlugin);
|
md.use(sanitizerPlugin);
|
||||||
|
|
||||||
// xmpp: should behave like mailto:
|
// xmpp: should behave like mailto:
|
||||||
md.linkify.add('xmpp:','mailto:');
|
md.linkify.add("xmpp:","mailto:");
|
||||||
|
// mumble:// should behave like http://:
|
||||||
|
md.linkify.add("mumble:","http:");
|
||||||
md.linkify.set({ fuzzyLink: false });
|
md.linkify.set({ fuzzyLink: false });
|
||||||
|
|
||||||
// Bootstrap table markup
|
// Bootstrap table markup
|
||||||
md.renderer.rules.table_open = function () { return '<table class="table table-striped">\n'; };
|
md.renderer.rules.table_open = function () { return "<table class=\"table table-striped\">\n"; };
|
||||||
|
|
||||||
return md.render(text);
|
return md.render(text);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -98,6 +98,7 @@ describe("app.helpers.textFormatter", function(){
|
||||||
"http://japan.co.jp",
|
"http://japan.co.jp",
|
||||||
"http://www.mygreat-example-website.de",
|
"http://www.mygreat-example-website.de",
|
||||||
"http://www.jenseitsderfenster.de", // from issue #3468
|
"http://www.jenseitsderfenster.de", // from issue #3468
|
||||||
|
"mumble://mumble.coding4.coffee",
|
||||||
"xmpp:podmin@pod.tld",
|
"xmpp:podmin@pod.tld",
|
||||||
"mailto:podmin@pod.tld"
|
"mailto:podmin@pod.tld"
|
||||||
];
|
];
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue