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:
parent
4a2d33f968
commit
d4663ed2e3
1 changed files with 6 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue