Skip to content

Commit 56f09d9

Browse files
Refine regex in setPreview function to handle additional whitespace scenarios and add logging for preview content.
1 parent ab0ac74 commit 56f09d9

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

dist/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34408,6 +34408,7 @@ const previewUpdater = async () => {
3440834408
// Read file
3440934409
const content = (0, filesystem_1.readFile)(config, config.path.readme);
3441034410
const preview = (0, preview_1.setPreview)(content, config);
34411+
console.log(preview);
3441134412
if (content === preview) {
3441234413
(0, core_1.info)(`File "${config.path.readme}" is up to date`);
3441334414
return;

src/utils/preview.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ export const setPreview = (content: string, config: Config) => {
1818

1919
const images: string = getImages(config)
2020

21-
return cleanUp(content).replace(/^(#\s+.+\n\n)/, '$1' + images + '\n\n')
21+
return cleanUp(content).replace(/^(#\s+.+[\n\s]+)/, '$1' + images + '\n\n')
2222
}

0 commit comments

Comments
 (0)