Skip to content

Commit

Permalink
Fixed spell effects including file names
Browse files Browse the repository at this point in the history
  • Loading branch information
Galarzaa90 committed Sep 10, 2021
1 parent 6daa19f commit d168332
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
7 changes: 7 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
Changelog
=========

.. 6.0.2
6.0.2 (2021-09-10)
==================

- Fixed spell effects including file names.

.. v6.0.1
6.0.1 (2021-08-18)
Expand Down
2 changes: 1 addition & 1 deletion tibiawikisql/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
__copyright__ = "Copyright 2021 Allan Galarza"

__license__ = "Apache 2.0"
__version__ = "6.0.1"
__version__ = "6.0.2"

from tibiawikisql import models
from tibiawikisql.api import Article, Image, WikiClient, WikiEntry
5 changes: 5 additions & 0 deletions tibiawikisql/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,13 @@ def clean_links(content, strip_question_mark=False):
:class:`str`:
The clean string, with no links.
"""
img = re.compile('(File|Image):', re.I)
content = re.sub(r"</?[bB][rR] ?/?>", "\n", content)
parsed = mwparserfromhell.parse(content)
# Remove image links as well
remove_img = [f for f in parsed.ifilter_wikilinks() if img.match(str(f.title))]
for f in remove_img:
parsed.remove(f)
content = parsed.strip_code().strip()
if strip_question_mark and content == "?":
return None
Expand Down

0 comments on commit d168332

Please sign in to comment.