Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions __tests__/ExpensiMark-HTML-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2320,6 +2320,11 @@ describe('room mentions', () => {
const resultString = 'hi all <mention-report>#room</mention-report>';
expect(parser.replace(testString)).toBe(resultString);
});
test('room mention with : as leading character', () => {
const testString = ':#room';
const resultString = ':<mention-report>#room</mention-report>';
expect(parser.replace(testString)).toBe(resultString);
});

test('room mention with leading word and no space', () => {
const testString = 'hi all#room';
Expand Down
2 changes: 1 addition & 1 deletion lib/ExpensiMark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ export default class ExpensiMark {
{
name: 'reportMentions',

regex: /(?<=^[*~_]?|[ \n][*~_]?)(#[\p{Ll}0-9-]{1,99})(?![^<]*(?:<\/pre>|<\/code>|<\/a>))/gimu,
regex: /(?<=^[*~_:]?|[ \n][*~_:]?|[:#])(#[\p{Ll}0-9-]{1,99})(?![^<]*(?:<\/pre>|<\/code>|<\/a>))/gimu,
replacement: '<mention-report>$1</mention-report>',
},

Expand Down