Skip to content

Commit

Permalink
Revert "remove unnecessary character from regex"
Browse files Browse the repository at this point in the history
This reverts commit 31e2b55.
  • Loading branch information
getusha committed May 1, 2023
1 parent 31e2b55 commit afb1d85
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 @@ -71,7 +71,8 @@ export default class ExpensiMark {
name: 'userMentions',
regex: /((&#x60;|<code>|<pre>)\s*?)?[`.]?@+[\w+]*@+\w*[.]+\w*/gm,
replacement: (match) => {
const isMatchValid = !(match.startsWith('.') || /(<code>|<pre>|&#x60;)/g.test(match));
const isMatchValid = !(match.startsWith('.') || /(<code>|<pre>|&#x60;|&#32;)/g.test(match));

if (match.endsWith('_') && isMatchValid) {
const mention = match.substring(0, match.length - 1);
return `<mention-user>${mention}</mention-user>_`;
Expand Down

0 comments on commit afb1d85

Please sign in to comment.