Skip to content

Commit

Permalink
add comment back
Browse files Browse the repository at this point in the history
  • Loading branch information
Skyweb331 committed May 20, 2024
1 parent d9a2499 commit cf1bb5f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/ExpensiMark.js
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,15 @@ 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
* The !_blank is to prevent the `target="_blank">` section of the
* link replacement from being captured Additionally, something like
* `\b\_([^<>]*?)\_\b` doesn't work because it won't replace
* `_https://www.test.com_`
* 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 cf1bb5f

Please sign in to comment.