Skip to content

Commit

Permalink
fix: parse intro without positive lookbehind regex (kolplattformen#102)
Browse files Browse the repository at this point in the history
  • Loading branch information
believer authored Mar 30, 2021
1 parent 73f6d8b commit f8b3df2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/parse.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion lib/parse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit f8b3df2

Please sign in to comment.