Fix link opening in new tab from chat.

master
Håvar Aambø Fosstveit 2020-01-17 08:17:44 +01:00
parent ac59253213
commit 894b39585f
1 changed files with 6 additions and 2 deletions

View File

@ -14,7 +14,7 @@ linkRenderer.link = (href, title, text) =>
title = title ? title : href;
text = text ? text : href;
return (`<a target='_blank' href='${ href }' title='${ title }'>${ text }</a>`);
return `<a target='_blank' href='${ href }' title='${ title }'>${ text }</a>`;
};
const styles = (theme) =>
@ -81,7 +81,11 @@ const Message = (props) =>
marked.parse(
text,
{ renderer: linkRenderer }
)
),
{
ALLOWED_TAGS : [ 'a' ],
ALLOWED_ATTR : [ 'href', 'target', 'title' ]
}
) }}
/>
<Typography variant='caption'>{self ? 'Me' : name} - {time}</Typography>