Skip to content

Commit

Permalink
Normalize spaces in headings titles (#437)
Browse files Browse the repository at this point in the history
The titles of the headings could contain newlines and other non-significant
spaces, as in "The\n  AbstractWorker mixin". They are now normalized to a
proper space, as in "The AbstractWorker mixin".
  • Loading branch information
tidoust authored Nov 5, 2020
1 parent 232fd8a commit f2552cf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion builds/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -3944,7 +3944,7 @@ for more information.`;

mappingTable[node.id] = {
id,
title: trimmedText.replace(reNumber, '').trim()
title: trimmedText.replace(reNumber, '').trim().replace(/\s+/g, ' ')
};

if (number) {
Expand Down
2 changes: 1 addition & 1 deletion src/browserlib/map-ids-to-headings.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export default function () {

mappingTable[node.id] = {
id,
title: trimmedText.replace(reNumber, '').trim()
title: trimmedText.replace(reNumber, '').trim().replace(/\s+/g, ' ')
};

if (number) {
Expand Down

0 comments on commit f2552cf

Please sign in to comment.