fix tags gluing

This commit is contained in:
Henry Jameson 2021-06-12 17:20:21 +03:00
parent 24f3681ac1
commit ca6c7d5b10

View file

@ -141,6 +141,7 @@ export default Vue.component('RichContent', {
if (attrs['class'] && attrs['class'].includes('mention')) { if (attrs['class'] && attrs['class'].includes('mention')) {
return renderMention(attrs, children, encounteredText) return renderMention(attrs, children, encounteredText)
} else if (attrs['class'] && attrs['class'].includes('hashtag')) { } else if (attrs['class'] && attrs['class'].includes('hashtag')) {
encounteredText = true
return item // We'll handle it later return item // We'll handle it later
} else { } else {
attrs.target = '_blank' attrs.target = '_blank'
@ -167,7 +168,7 @@ export default Vue.component('RichContent', {
// Handle text nodes - just add emoji // Handle text nodes - just add emoji
if (typeof item === 'string') { if (typeof item === 'string') {
const emptyText = item.trim() === '' const emptyText = item.trim() === ''
if (emptyText) return encounteredTextReverse ? item : item.trim() if (emptyText) return item
if (!encounteredTextReverse) encounteredTextReverse = true if (!encounteredTextReverse) encounteredTextReverse = true
return item return item
} else if (Array.isArray(item)) { } else if (Array.isArray(item)) {