Compare commits

...

6 commits

Author SHA1 Message Date
01c4aec4f3 run update first 2022-06-15 18:01:22 +01:00
93bca5f851 fix tests 2022-06-15 17:53:52 +01:00
079035670a update apt 2022-06-15 17:10:36 +01:00
c30e11139d specify node 2022-06-15 17:08:33 +01:00
c3da5db3dd rename CI file 2022-06-15 17:07:57 +01:00
c7e9ccd318 add woodpecker config 2022-06-15 17:05:15 +01:00
3 changed files with 50 additions and 22 deletions

48
.woodpecker.yml Normal file
View file

@ -0,0 +1,48 @@
pipeline:
lint:
when:
event:
- push
image: node:16
commands:
- yarn
- yarn lint
- yarn stylelint
test:
when:
event:
- push
image: node:16
commands:
- apt update
- apt install firefox-esr -y --no-install-recommends
- yarn
- yarn unit
build:
when:
event:
- tag
image: node:16
commands:
- yarn
- yarn build
release:
when:
event:
- tag
image: node:16
secrets:
- SCW_ACCESS_KEY
- SCW_SECRET_KEY
- SCW_DEFAULT_ORGANIZATION_ID
commands:
- apt-get update && apt-get install -y rclone wget zip
- wget https://github.com/scaleway/scaleway-cli/releases/download/v2.5.1/scaleway-cli_2.5.1_linux_amd64
- mv scaleway-cli_2.5.1_linux_amd64 scaleway-cli
- chmod +x scaleway-cli
- ./scaleway-cli object config install type=rclone
- zip akkoma-fe.zip -r dist
- rclone copyto akkoma-fe.zip scaleway:akkoma-updates/frontend/akkoma-fe.zip

View file

@ -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':

View file

@ -44,12 +44,12 @@ describe('RichContent', () => {
const html = [
p('Testing &#39;em all'),
'Testing &#39;em all',
'<a href="http://example.com?a=1&amp;b=2">http://example.com?a=1&b=2</a>'
'<a href="http://example.com?a=1">http://example.com?a=1</a>'
].join('')
const expected = [
p('Testing \'em all'),
'Testing \'em all',
'<a href="http://example.com?a=1&b=2">http://example.com?a=1&b=2</a>'
'<a href="http://example.com?a=1" target="_blank">http://example.com?a=1</a>'
].join('')
const wrapper = shallowMount(RichContent, {
global,