From f5e2db6e0f509d25511d259d379ffd72f026d42d Mon Sep 17 00:00:00 2001 From: Eric Han Date: Tue, 13 Jun 2023 00:52:43 +0800 Subject: [PATCH] improve comment --- lib/ExpensiMark.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ExpensiMark.js b/lib/ExpensiMark.js index bebf21fd..3dec53be 100644 --- a/lib/ExpensiMark.js +++ b/lib/ExpensiMark.js @@ -183,7 +183,8 @@ export default class ExpensiMark { name: 'italic', regex: /(\b_+|\b)(?!_blank")_((?![\s_])[\s\S]*?[^\s_])_(?![^\W_])(?![^<]*(<\/pre>|<\/code>|<\/a>|<\/mention-user>|_blank))/g, - // We add g1 which is underscores or empty string back before the tag + // g1 is empty string or includes one or more underscores, eg: `hello ___world_` + // We want to add g1 back before the tag replacement: (match, g1, g2) => (g2.includes('
') || this.containsNonPairTag(g2) ? match : `${g1}${g2}`),
             },
             {