Skip to content

Commit

Permalink
fix: image_pattern worked wrong in case of multiple links in one line (
Browse files Browse the repository at this point in the history
…#21)

* update (README.md): add example for code include

close #16

* fix: image_pattern worked wrong in case of multiple links in one line

* update(changelog): bump version to 1.1.14
  • Loading branch information
holamgadol authored Dec 27, 2022
1 parent 57fc3cc commit 333b08e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 1.1.14

- Fix `image_pattern` for `adjust_image_paths` method

# 1.1.13

- When getting the included content by URL, take into account the `charset` parameter of the `Content-Type` response header field.
Expand Down
2 changes: 1 addition & 1 deletion foliant/preprocessors/includes.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class Preprocessor(BasePreprocessor):
flags=re.MULTILINE
)

_image_pattern = re.compile(r'\!\[(?P<caption>.*)\]\((?P<path>((?!:\/\/).)+)\)')
_image_pattern = re.compile(r'\!\[(?P<caption>.*?)\]\((?P<path>((?!:\/\/).)+?)\)')

_tag_body_pattern = re.compile(
r'(\$(?P<repo>[^\#^\$]+)(\#(?P<revision>[^\$]+))?\$)?' +
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
description=SHORT_DESCRIPTION,
long_description=LONG_DESCRIPTION,
long_description_content_type='text/markdown',
version='1.1.13',
version='1.1.14',
author='Konstantin Molchanov',
author_email='[email protected]',
url='https://github.com/foliant-docs/foliantcontrib.includes',
Expand Down

0 comments on commit 333b08e

Please sign in to comment.