From d548f128d9e6e275a98ccd7fa10993f619ba37a2 Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 9 Feb 2017 23:03:16 +0900 Subject: [PATCH] Add block comment support --- src/common/text/elements/code.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/common/text/elements/code.js b/src/common/text/elements/code.js index bda3816a7b..23074741af 100644 --- a/src/common/text/elements/code.js +++ b/src/common/text/elements/code.js @@ -101,6 +101,16 @@ const elements = [ }; }, + // block comment + code => { + const match = code.match(/^\/\*([\s\S]+?)\*\//); + if (!match) return null; + return { + html: `${escape(match[0])}`, + next: match[0].length + }; + }, + // string code => { if (!/^['"`]/.test(code)) return null;