From f7b656443df328947acd0ce09412735f67c74eb3 Mon Sep 17 00:00:00 2001 From: Zhicheng Wang Date: Sun, 30 Jul 2017 16:23:26 +0800 Subject: [PATCH] fix: limit tagName to whole world --- aio/tools/transforms/remark-package/services/translator.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aio/tools/transforms/remark-package/services/translator.js b/aio/tools/transforms/remark-package/services/translator.js index dbe8973727..54ae070db3 100644 --- a/aio/tools/transforms/remark-package/services/translator.js +++ b/aio/tools/transforms/remark-package/services/translator.js @@ -1,5 +1,5 @@ function mark(text) { - return text.replace(/<(h\d|header|p|a)([\s\S]*?)>([\s\S]+?)<\/\1>/gi, function ($0, $1, $2, $3) { + return text.replace(/<(h\d|header|p|a)(\b[\s\S]*?)>([\s\S]+?)<\/\1>/gi, function ($0, $1, $2, $3) { const suffix = isTranslation($3) ? 'result' : 'origin=off'; return `<${$1} translation-${suffix} ${$2}>${$3}`; });