diff --git a/material/plugins/social/plugin.py b/material/plugins/social/plugin.py index edbb91d1da8..2e989c1560d 100644 --- a/material/plugins/social/plugin.py +++ b/material/plugins/social/plugin.py @@ -42,6 +42,7 @@ from collections import defaultdict from hashlib import md5 +from html import unescape from io import BytesIO from mkdocs.commands.build import DuplicateFilter from mkdocs.exceptions import PluginError @@ -298,8 +299,9 @@ def _render_text(self, size, font, text, lmax, spacing = 0): width = size[0] lines, words = [], [] - # Remove remnant HTML tags + # Remove remnant HTML tags and convert HTML entities text = re.sub(r"(<[^>]+>)", "", text) + text = unescape(text) # Retrieve y-offset of textbox to correct for spacing yoffset = 0 diff --git a/src/plugins/social/plugin.py b/src/plugins/social/plugin.py index edbb91d1da8..2e989c1560d 100644 --- a/src/plugins/social/plugin.py +++ b/src/plugins/social/plugin.py @@ -42,6 +42,7 @@ from collections import defaultdict from hashlib import md5 +from html import unescape from io import BytesIO from mkdocs.commands.build import DuplicateFilter from mkdocs.exceptions import PluginError @@ -298,8 +299,9 @@ def _render_text(self, size, font, text, lmax, spacing = 0): width = size[0] lines, words = [], [] - # Remove remnant HTML tags + # Remove remnant HTML tags and convert HTML entities text = re.sub(r"(<[^>]+>)", "", text) + text = unescape(text) # Retrieve y-offset of textbox to correct for spacing yoffset = 0