Skip to content

Commit

Permalink
added whitespace before and after a tag
Browse files Browse the repository at this point in the history
  • Loading branch information
aferditamuriqi committed Sep 21, 2020
1 parent 0f22e3d commit 9bf4a9f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/modules/TTS/splitting.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ function splitText(el, key, splitOn, includePrevious, preserveWhitespace) {
// If there's no text left after trimming whitespace, continue the loop
if (contentsTrimmed.length) {
// insert leading space if there was one
allElements.push(createElement(F, "whitespace", " ", preserveWhitespace));
if (wholeText[0] === ' ') {
allElements.push(createText(' '));
}
Expand All @@ -252,6 +253,7 @@ function splitText(el, key, splitOn, includePrevious, preserveWhitespace) {
if (wholeText[wholeText.length - 1] === ' ') {
allElements.push(createText(' '));
}
allElements.push(createElement(F, "whitespace", " ", preserveWhitespace));
} else {
allElements.push(createElement(F, "whitespace", " ", preserveWhitespace));
}
Expand Down

0 comments on commit 9bf4a9f

Please sign in to comment.