Skip to content

Commit

Permalink
improve comment
Browse files Browse the repository at this point in the history
  • Loading branch information
eh2077 committed Jun 13, 2023
1 parent 45a38d6 commit f5e2db6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/ExpensiMark.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 <em> tag
// g1 is empty string or includes one or more underscores, eg: `hello ___world_`
// We want to add g1 back before the <em> tag
replacement: (match, g1, g2) => (g2.includes('<pre>') || this.containsNonPairTag(g2) ? match : `${g1}<em>${g2}</em>`),
},
{
Expand Down

0 comments on commit f5e2db6

Please sign in to comment.