From 682bbbeca48563e14a2b7f03c0334df233569452 Mon Sep 17 00:00:00 2001 From: Butch Marshall Date: Mon, 27 Jun 2016 15:43:51 +0000 Subject: [PATCH] Fixed IE8 regex compatability --- src/subParsers/italicsAndBold.js | 4 ++-- src/subParsers/tables.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/subParsers/italicsAndBold.js b/src/subParsers/italicsAndBold.js index cb51f6c..ebf84f6 100644 --- a/src/subParsers/italicsAndBold.js +++ b/src/subParsers/italicsAndBold.js @@ -6,8 +6,8 @@ showdown.subParser('italicsAndBold', function (text, options, globals) { if (options.literalMidWordUnderscores) { //underscores // Since we are consuming a \s character, we need to add it - text = text.replace(/(^|\s|>|\b)__(?=\S)([^]+?)__(?=\b|<|\s|$)/gm, '$1$2'); - text = text.replace(/(^|\s|>|\b)_(?=\S)([^]+?)_(?=\b|<|\s|$)/gm, '$1$2'); + text = text.replace(/(^|\s|>|\b)__(?=\S)([\s\S]+?)__(?=\b|<|\s|$)/gm, '$1$2'); + text = text.replace(/(^|\s|>|\b)_(?=\S)([\s\S]+?)_(?=\b|<|\s|$)/gm, '$1$2'); //asterisks text = text.replace(/(\*\*)(?=\S)([^\r]*?\S[*]*)\1/g, '$2'); text = text.replace(/(\*)(?=\S)([^\r]*?\S)\1/g, '$2'); diff --git a/src/subParsers/tables.js b/src/subParsers/tables.js index 767612d..293d06d 100644 --- a/src/subParsers/tables.js +++ b/src/subParsers/tables.js @@ -5,7 +5,7 @@ showdown.subParser('tables', function (text, options, globals) { return text; } - var tableRgx = /^[ \t]{0,3}\|?.+\|.+\n[ \t]{0,3}\|?[ \t]*:?[ \t]*(?:-|=){2,}[ \t]*:?[ \t]*\|[ \t]*:?[ \t]*(?:-|=){2,}[^]+?(?:\n\n|~0)/gm; + var tableRgx = /^[ \t]{0,3}\|?.+\|.+\n[ \t]{0,3}\|?[ \t]*:?[ \t]*(?:-|=){2,}[ \t]*:?[ \t]*\|[ \t]*:?[ \t]*(?:-|=){2,}[\s\S]+?(?:\n\n|~0)/gm; function parseStyles(sLine) { if (/^:[ \t]*--*$/.test(sLine)) {