mirror of
https://github.com/rr-/szurubooru.git
synced 2025-07-17 08:26:24 +00:00
Added [sjis]...[/sjis] tag
This commit is contained in:
@ -193,7 +193,14 @@ App.Util.Misc = function(_, jQuery, marked, promise) {
|
||||
smartypants: true,
|
||||
};
|
||||
|
||||
var sjis = [];
|
||||
|
||||
var preDecorator = function(text) {
|
||||
text = text.replace(/\[sjis\]((?:[^\[]|\[(?!\/?sjis\]))+)\[\/sjis\]/ig, function(match, capture) {
|
||||
var ret = '%%%SJIS' + sjis.length;
|
||||
sjis.push(capture);
|
||||
return ret;
|
||||
});
|
||||
//prevent ^#... from being treated as headers, due to tag permalinks
|
||||
text = text.replace(/^#/g, '%%%#');
|
||||
//fix \ before ~ being stripped away
|
||||
@ -211,6 +218,8 @@ App.Util.Misc = function(_, jQuery, marked, promise) {
|
||||
text = text.replace(/%%%T/g, '\\~');
|
||||
text = text.replace(/%%%#/g, '#');
|
||||
|
||||
text = text.replace(/%%%SJIS(\d+)/, function(match, capture) { return '<div class="sjis">' + sjis[capture] + '</div>'; });
|
||||
|
||||
//search permalinks
|
||||
text = text.replace(/\[search\]((?:[^\[]|\[(?!\/?search\]))+)\[\/search\]/ig, '<a href="#/posts/query=$1"><code>$1</code></a>');
|
||||
//spoilers
|
||||
|
Reference in New Issue
Block a user