Merge pull request #2872 from j-f1/remove-wp-smiley

Remove wp-smiley images
This commit is contained in:
Maurice Parker
2021-03-12 11:33:15 -06:00
committed by GitHub
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;