fix: parse intro without positive lookbehind regex (#102)

This commit is contained in:
Rickard Natt och Dag 2021-03-30 17:44:52 +02:00 committed by GitHub
parent 73f6d8ba72
commit f8b3df2936
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -271,7 +271,7 @@ describe('parse', () => {
ModDateSE: '18 december 2020 16:18',
Source: 'Livets hårda skolklasser',
Preamble:
'Hej, Nu är problemet löst! Alla betyg syns som de ska. God jul!...',
'Hej,Nu är problemet löst! Alla betyg syns som de ska.God jul!...',
BannerImageUrl: 'A703552D-DBF3-45B0-8E67-6E062105A0C5.jpeg',
BannerImageGuid: 'A703552D-DBF3-45B0-8E67-6E062105A0C5',
BannerImageListId: 'FFBE49E9-BDE1-4C75-BA0E-D98D4E2FCF21',

View File

@ -150,7 +150,7 @@ export const newsItem = ({
modified,
id: newsId,
author: authorDisplayName,
intro: preamble.replace(/(?<=[,.!])(\w)/ig, ' $1'),
intro: preamble.replace(/([!,.])(\w)/gi, '$1 $2'),
imageUrl: bannerImageUrl,
fullImageUrl: `${IMAGE_HOST}${bannerImageUrl}`,
imageAltText: altText,