Give highlights a little padding

This commit is contained in:
Gabe Kangas 2020-09-12 18:01:53 -07:00
parent 7b11c65187
commit 4c497454b6

View File

@ -24,7 +24,10 @@ export function formatMessageText(message, username) {
function highlightUsername(message, username) {
const pattern = new RegExp('@?' + username.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'), 'gi');
return message.replace(pattern, '<span class="highlighted font-bold bg-orange-500">$&</span>');
return message.replace(
pattern,
'<span class="highlighted px-1 rounded font-bold bg-orange-500">$&</span>'
);
}
function linkify(text, rawText) {