Skip to content

Commit 732ee1a

Browse files
committed
Fix ignore emojis (#1)
1 parent f91165f commit 732ee1a

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

CHANGELOG

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
mkdocs-glightbox-0.1.7 (2022-07-26)
2+
3+
* Fix #1: Ignore Emojis
4+
15
mkdocs-glightbox-0.1.6 (2022-07-16)
26

37
* Fix some options not working bug

mkdocs_glightbox/plugin.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,13 @@ def on_post_page(self, output, page, config, **kwargs):
6464

6565
def on_page_content(self, html, page, config, **kwargs):
6666
""" Wrap img tag with archive tag with glightbox class and attributes from config """
67+
# skip emoji img with index as class name from pymdownx.emoji https://facelessuser.github.io/pymdown-extensions/extensions/emoji/
68+
skip_class = ["emojione", "twemoji", "gemoji"]
6769
soup = BeautifulSoup(html, "html.parser")
6870
imgs = soup.find_all("img")
6971
for img in imgs:
72+
if set(skip_class) & set(img.get("class", [])):
73+
continue
7074
a = soup.new_tag("a")
7175
a["class"] = "glightbox"
7276
a["href"] = img.get("src", "")

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
setup(
88
name="mkdocs-glightbox",
9-
version="0.1.6",
9+
version="0.1.7",
1010
author="Blueswen",
1111
author_email="[email protected]",
1212
url = "https://blueswen.github.io/mkdocs-glightbox",

0 commit comments

Comments
 (0)