Remove wp-smiley images

This commit is contained in:
Jed Fox 2021-03-11 22:47:34 -05:00
parent 1b6ec8cfd7
commit 38827a8c2a
No known key found for this signature in database
GPG Key ID: 0B61D18EA54B47E1
2 changed files with 9 additions and 0 deletions

View File

@ -154,6 +154,13 @@ function styleLocalFootnotes() {
}
}
// convert <img alt="📰" src="[...]" class="wp-smiley"> to a text node containing 📰
function removeWpSmiley() {
for (const img of document.querySelectorAll("img.wp-smiley[alt]")) {
img.parentNode.replaceChild(document.createTextNode(img.alt), img);
}
}
function processPage() {
wrapFrames();
wrapTables();
@ -163,5 +170,6 @@ function processPage() {
convertImgSrc();
flattenPreElements();
styleLocalFootnotes();
removeWpSmiley()
postRenderProcessing();
}

View File

@ -257,6 +257,7 @@ blockquote {
border-top: 1px solid var(--header-table-border-color);
}
/* see removeWpSmiley; this rule is kept in case a wp-smiley is encountered without alt text */
.wp-smiley {
height: 1em;
max-height: 1em;