Skip to content
This repository was archived by the owner on Jan 21, 2021. It is now read-only.

Commit 0c22f1f

Browse files
authored
[v3]: Remove whitespace around inserted links
1 parent 2874003 commit 0c22f1f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/lib/insert-links-into-head.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ function insertLinksIntoHead({html, links=[]}) {
2222

2323
if (html.includes('</head>')) {
2424
// If a valid closing </head> is found, insert the new <link>s right before it.
25-
return html.replace('</head>', links.join('\n') + '\n</head>');
25+
return html.replace('</head>', links.join('') + '</head>');
2626
}
2727

2828
if (html.includes('<body>')) {
2929
// If there's a <body> but no <head>, create a <head> containing the <head>.
30-
return html.replace('<body>', `<head>\n${links.join('\n')}\n</head>\n<body>`);
30+
return html.replace('<body>', `<head>${links.join('')}\n</head><body>`);
3131
}
3232

3333
throw new Error(`The HTML provided did not contain a </head> or a <body>:\n\n${html}`);

0 commit comments

Comments
 (0)