Created
April 13, 2020 02:55
-
-
Save robinsloan/addb27d6004e6698a40c3eee0a4919b2 to your computer and use it in GitHub Desktop.
Just a little snippet for Tom
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
F.visibleTextFragments.push(newFragment); | |
let text = `<p>`; | |
if (F.visibleTextFragments.length > 0) { | |
let visibleText = F.visibleTextFragments.reduce(function(visibleFragments, thisFragment) { | |
return visibleFragments + thisFragment; | |
}); | |
text += `<span class="visible">${visibleText}</span>`; | |
} | |
if (F.invisibleTextFragments.length > 0) { | |
let invisibleText = F.invisibleTextFragments.reduce(function(invisibleFragments, thisFragment) { | |
return invisibleFragments + thisFragment; | |
}); | |
text += `<span class="invisible">${invisibleText}</span>`; | |
} | |
text += `</p>`; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment