Skip to content

Commit

Permalink
Fix broken blob syntax after last update
Browse files Browse the repository at this point in the history
  • Loading branch information
abdnh committed Sep 20, 2023
1 parent 8b90ab9 commit f74a6aa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.5.8] - 2023-09-20

### Fixed

- Fixed media importing broken for some users.

## [1.5.7] - 2023-09-17

### Fixed
Expand Down Expand Up @@ -111,7 +117,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [1.0.0] - 2022-01-17

Initial release

[1.5.8]: https://github.com/abdnh/AnkiApp-importer/compare/1.5.7...1.5.8
[1.5.7]: https://github.com/abdnh/AnkiApp-importer/compare/1.5.6...1.5.7
[1.5.6]: https://github.com/abdnh/AnkiApp-importer/compare/1.5.5...1.5.6
[1.5.5]: https://github.com/abdnh/AnkiApp-importer/compare/1.5.4...1.5.5
Expand Down
4 changes: 2 additions & 2 deletions src/ankiapp_importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,8 @@ class AnkiAppImporter:
def __init__(self, mw: AnkiQt, filename: str):
self.mw = mw
self.BLOB_REF_PATTERNS = (
# Use Anki's HTML media patterns too for completeness
*(re.compile(p) for p in mw.col.media.html_media_regexps),
re.compile(r"{{blob (?P<fname>.*?)}}"),
# AnkiApp uses a form like `<audio id="{blob_id}" type="{mime_type}" />` too
# TODO: extract the type attribute
Expand All @@ -250,8 +252,6 @@ def __init__(self, mw: AnkiQt, filename: str):
re.compile(
r"(?i)(<(?:img|audio)\b[^>]* id=(?!['\"])(?P<fname>[^ >]+)[^>]*?>)"
),
# Use Anki's HTML media patterns too for completeness
*(re.compile(p) for p in mw.col.media.html_media_regexps),
)
self.config = mw.addonManager.getConfig(__name__)
self.con = sqlite3.connect(filename)
Expand Down

0 comments on commit f74a6aa

Please sign in to comment.