mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-08-31 01:01:11 +08:00
fix(route): node.js 14 has no replaceAll (#9323)
Signed-off-by: Rongrong <15956627+Rongronggg9@users.noreply.github.com>
This commit is contained in:
@@ -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}}
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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 }}
|
||||
|
||||
Reference in New Issue
Block a user