diff --git a/public_html/js/Util.js b/public_html/js/Util.js index 983ea63c..5750f700 100644 --- a/public_html/js/Util.js +++ b/public_html/js/Util.js @@ -189,7 +189,9 @@ App.Util = function(_, jQuery, marked, promise) { var preDecorator = function(text) { //prevent ^#... from being treated as headers, due to tag permalinks - text = text.replace(/^#/g, '%%%#'); + text = text.replace(/^#/g, '%%%\0'); + //fix \ before ~ being stripped away + text = text.replace(/\\~/g, '%%%\0'); return text; }; @@ -202,7 +204,7 @@ App.Util = function(_, jQuery, marked, promise) { //spoilers text = text.replace(/\[spoiler\]((?:[^\[]|\[(?!\/?spoiler\]))+)\[\/spoiler\]/ig, '$1'); //strike-through - text = text.replace(/(~~|~)([^~]+)\1/g, '$2'); + text = text.replace(/(^|[^\\])(~~|~)([^~]+)\2/g, '$1$3'); //post premalinks text = text.replace(/(^|[\s<>\(\)\[\]])@(\d+)/g, '$1@$2'); //user permalinks