Skip to content

Commit 6bda5b8

Browse files
authored
Merge pull request #82 from Financial-Times/stronger-whitespace-check
More rigourous removal of weird whitespace at the end of paragraph
2 parents e76b3ad + 331b5c4 commit 6bda5b8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

libraries/from-bodyxml/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ export function fromXast(bodyxast, transformers = defaultTransformers) {
444444
* @returns {string}
445445
*/
446446
function removeWhitespaceBeforeBodyTag(xml) {
447-
return xml.replace("</p> </body>", "</p></body>");
447+
return xml.replace(/<\/p>\s+<\/body>/gi, '</p></body>');
448448
}
449449

450450
/** @param {string} bodyxml */

0 commit comments

Comments
 (0)