Skip to content

Commit 8a97840

Browse files
committed
close opened img tags
1 parent b492178 commit 8a97840

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/utilities/process-readme.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,11 @@ module.exports = function processREADME(body, options = {}) {
9898
let parsed = content.match(/<p>\s+([^]*?)\s+<\/?p>/);
9999
return parsed ? parsed[1] : '';
100100
})
101+
// close <img> tags
102+
.replace(
103+
/<(img\s[^>]*?src\s*=\s*['"][^'"]*?['"][^>/]*?)>(?![^<]*<\/img)/g,
104+
'<$1/>'
105+
)
101106
// Replace lone h1 formats
102107
.replace(/<h1.*?>.+?<\/h1>/, '')
103108
.replace(/^# .+/m, '')

0 commit comments

Comments
 (0)