Replace WordPress <img>s with emoji

Noticed via the validation discussed in #22, which was failing on the draggable attribute.
This commit is contained in:
Domenic Denicola 2020-12-31 13:53:11 -05:00
commit d4663ed2e3

View file

@ -243,6 +243,12 @@ function getBodyXML(chapter, book, contentEl) {
xml = xml.replace(/ ? <\/p>/g, "</p>");
xml = xml.replace(/([a-z]) ,/g, "$1,");
// Use actual emojis instead of images
xml = xml.replace(
// eslint-disable-next-line max-len
/<img width="16" height="16" class="wp-smiley emoji" draggable="false" alt="O_o" src="https:\/\/s1.wp.com\/wp-content\/mu-plugins\/wpcom-smileys\/o_O.svg" style="height: 1em; max-height: 1em;" \/>/g,
"🤨");
xml = fixTruncatedWords(xml);
xml = fixDialogueTags(xml);
xml = fixForeignNames(xml);