mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-16 06:07:21 +01:00
Merge branch 'develop' into release
This commit is contained in:
@@ -64,6 +64,44 @@ describe('highlightMentions', () => {
|
||||
expect(result[0]).to.equal(text);
|
||||
});
|
||||
|
||||
describe('link interactions', async () => {
|
||||
it('doesn\'t highlight users in link', async () => {
|
||||
const text = 'http://www.medium.com/@user/blog';
|
||||
const result = await highlightMentions(text);
|
||||
expect(result[0]).to.equal(text);
|
||||
});
|
||||
|
||||
it('doesn\'t highlight user in link between brackets', async () => {
|
||||
const text = '(http://www.medium.com/@user/blog)';
|
||||
const result = await highlightMentions(text);
|
||||
expect(result[0]).to.equal(text);
|
||||
});
|
||||
|
||||
it('doesn\'t highlight user in an autolink', async () => {
|
||||
const text = '<http://www.medium.com/@user/blog>';
|
||||
const result = await highlightMentions(text);
|
||||
expect(result[0]).to.equal(text);
|
||||
});
|
||||
|
||||
it('doesn\'t highlight users in link text', async () => {
|
||||
const text = '[Check awesome blog written by @user](http://www.medium.com/@user/blog)';
|
||||
const result = await highlightMentions(text);
|
||||
expect(result[0]).to.equal(text);
|
||||
});
|
||||
|
||||
it('doesn\'t highlight users in link with newlines and markup', async () => {
|
||||
const text = '[Check `awesome` \nblog **written** by @user](http://www.medium.com/@user/blog)';
|
||||
const result = await highlightMentions(text);
|
||||
expect(result[0]).to.equal(text);
|
||||
});
|
||||
|
||||
it('doesn\'t highlight users in link when followed by same @user mention', async () => {
|
||||
const text = 'http://www.medium.com/@user/blog @user';
|
||||
const result = await highlightMentions(text);
|
||||
expect(result[0]).to.equal('http://www.medium.com/@user/blog [@user](/profile/111)');
|
||||
});
|
||||
});
|
||||
|
||||
describe('exceptions in code blocks', () => {
|
||||
it('doesn\'t highlight user in inline code block', async () => {
|
||||
const text = '`@user`';
|
||||
|
||||
Reference in New Issue
Block a user