mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-11-27 17:00:54 +01:00
Fixed HTML entities not escaped in social cards
This commit is contained in:
parent
67f17524d9
commit
b655e07805
@ -42,6 +42,7 @@ import sys
|
||||
|
||||
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 @@ class SocialPlugin(BasePlugin[SocialConfig]):
|
||||
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
|
||||
|
@ -42,6 +42,7 @@ import sys
|
||||
|
||||
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 @@ class SocialPlugin(BasePlugin[SocialConfig]):
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user