fix(route): node.js 14 has no replaceAll (#9323)

Signed-off-by: Rongrong <15956627+Rongronggg9@users.noreply.github.com>
This commit is contained in:
Rongrong
2022-03-15 17:09:01 +08:00
committed by GitHub
parent b766eb4bcc
commit 96e803fba6
3 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -13,7 +13,7 @@
<p>
<b>Release Notes</b>:
</p>
{{@ releaseNotes.trim().replaceAll('\n', '<br>') }}
{{@ releaseNotes.trim().replace(/\n/g, '<br>') }}
{{/if}}
<p>
{{if downloadUrl===installUrl}}
+3 -3
View File
@@ -70,9 +70,9 @@ module.exports = async (ctx) => {
.find('.photo-description')
.text()
.trim()
.replaceAll(/[^\S\n]+/g, ' ')
.replaceAll(/((?<=\n|^)[^\S\n])|([^\S\n](?=\n|$))/g, '');
const title = postText.replaceAll('\n', ' ') || 'Untitled';
.replace(/[^\S\n]+/g, ' ')
.replace(/((?<=\n|^)[^\S\n])|([^\S\n](?=\n|$))/g, '');
const title = postText.replace(/\n/g, ' ') || 'Untitled';
const description = art(path.join(__dirname, 'templates/post.art'), {
media: displayVideo ? media_displayVideo : deVideo(media_displayVideo),
desc: postText,
+2 -2
View File
@@ -1,5 +1,5 @@
{{ if media }}{{@ media.replaceAll('\n', '') }}{{ /if }}
{{ if desc }}<p>{{@ desc.replaceAll('\n', '<br>') }}</p>{{ /if }}
{{ if media }}{{@ media.replace(/\n/g, '') }}{{ /if }}
{{ if desc }}<p>{{@ desc.replace(/\n/g, '<br>') }}</p>{{ /if }}
{{ if locationLink.length && locationLink.attr('href') }}
<p>📍 <small><a href="{{ locationLink.attr('href') }}">{{ locationLink.text() }}</a></small></p>
{{ else if locationLink.length }}