Skip to content

Commit

Permalink
add comment for italic rules
Browse files Browse the repository at this point in the history
  • Loading branch information
Skyweb331 committed May 29, 2024
1 parent c1cfdae commit 4ef55d7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/ExpensiMark.js
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,11 @@ export default class ExpensiMark {
return `<blockquote>${isStartingWithSpace ? ' ' : ''}${replacedText}</blockquote>`;
},
},
/**
* Use \b in this case because it will match on words, letters,
* and _: https://www.rexegg.com/regex-boundaries.html#wordboundary
* Use [\s\S]* instead of .* to match newline
*/
{
name: 'italic',
regex: /(<(pre|code|a|mention-user)[^>]*>(.*?)<\/\2>)|((\b_+|\b)_((?![\s_])[\s\S]*?[^\s_](?<!\s))_(?![^\W_])(?![^<]*>)(?![^<]*(<\/pre>|<\/code>|<\/a>|<\/mention-user>)))/g,
Expand Down

0 comments on commit 4ef55d7

Please sign in to comment.