fix tests and add CI (#5)
Co-authored-by: FloatingGhost <hannah@coffee-and-dreams.uk> Reviewed-on: http://akkoma.dev/AkkomaGang/pleroma-fe/pulls/5
This commit is contained in:
parent
1ad17fc2bf
commit
a0305e90f0
3 changed files with 50 additions and 22 deletions
|
@ -112,23 +112,6 @@ export default {
|
|||
}
|
||||
}
|
||||
|
||||
const renderLink = (attrs, children) => {
|
||||
const updatedLink = attrs['href'].replace(/&/g, '&')
|
||||
const updatedChildren = children.map(child => {
|
||||
if (typeof child === 'string') {
|
||||
return child.replace(attrs['href'], updatedLink)
|
||||
}
|
||||
if (child[0] === '<span>') {
|
||||
return <span>
|
||||
{ child[1] }
|
||||
</span>
|
||||
}
|
||||
return child[1]
|
||||
})
|
||||
return <a {...{ attrs }} href={updatedLink}>
|
||||
{ ...updatedChildren }
|
||||
</a>
|
||||
}
|
||||
// Processor to use with html_tree_converter
|
||||
const processItem = (item, index, array, what) => {
|
||||
// Handle text nodes - just add emoji
|
||||
|
@ -193,9 +176,6 @@ export default {
|
|||
return renderMention(attrs, children)
|
||||
} else {
|
||||
currentMentions = null
|
||||
if (attrs['href']) {
|
||||
return renderLink(attrs, children)
|
||||
}
|
||||
break
|
||||
}
|
||||
case 'span':
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue