mkdocs-include-markdown-plugin 7.3.0__py3-none-any.whl → 7.3.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9,6 +9,7 @@ import re
9
9
  import stat
10
10
  from collections.abc import Callable, Iterator
11
11
  from typing import TYPE_CHECKING
12
+ from urllib.parse import urljoin
12
13
 
13
14
 
14
15
  if TYPE_CHECKING: # pragma: no cover
@@ -291,8 +292,16 @@ def rewrite_relative_urls(
291
292
  ``source_path`` will still work when inserted into a file at
292
293
  ``destination_path``.
293
294
  """
295
+ source_is_url = is_url(source_path)
296
+
294
297
  def rewrite_url(url: str) -> str:
295
- if is_url(url) or is_absolute_path(url) or is_anchor(url):
298
+ if is_anchor(url):
299
+ return url
300
+
301
+ if source_is_url:
302
+ return url if is_url(url) else urljoin(source_path, url)
303
+
304
+ if is_url(url) or is_absolute_path(url):
296
305
  return url
297
306
 
298
307
  new_path = os.path.relpath(
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.5
2
2
  Name: mkdocs-include-markdown-plugin
3
- Version: 7.3.0
3
+ Version: 7.3.1
4
4
  Summary: Mkdocs Markdown includer plugin.
5
5
  Project-URL: Source, https://github.com/mondeja/mkdocs-include-markdown-plugin
6
6
  Project-URL: Documentation, https://github.com/mondeja/mkdocs-include-markdown-plugin#documentation
@@ -7,10 +7,10 @@ mkdocs_include_markdown_plugin/files_watcher.py,sha256=hu-63u8syl00mXP59vP_iqD7T
7
7
  mkdocs_include_markdown_plugin/logger.py,sha256=nl63G4IJSt5mEYHbObuh7BmmowSv-aa1l_v9I257570,230
8
8
  mkdocs_include_markdown_plugin/placeholders.py,sha256=LBxFagmDDJ8le4AYrLJbt7WqYBu-kpJP6QqGWH7tDrs,1132
9
9
  mkdocs_include_markdown_plugin/plugin.py,sha256=t7eIgB3Z6XmcPOzlTqE15ajhY3oYPNKOZLb6D1_hx7I,4334
10
- mkdocs_include_markdown_plugin/process.py,sha256=TKT1V0VHGqLGeFDrsNoKroXmqkjqwPM22IRDwvsemtE,22776
10
+ mkdocs_include_markdown_plugin/process.py,sha256=XOCJ58uQsjCmRDsjGTQj85XI46nPNT3xPq6QIDIncOY,22979
11
11
  mkdocs_include_markdown_plugin/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
12
- mkdocs_include_markdown_plugin-7.3.0.dist-info/METADATA,sha256=IyyxjZ2hzzW366rIknx70GnykwJ1zU4R2SGYkSDuFkY,12888
13
- mkdocs_include_markdown_plugin-7.3.0.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
14
- mkdocs_include_markdown_plugin-7.3.0.dist-info/entry_points.txt,sha256=WEL5m7sw5ZMBwmdOs5S_9mGoZfLCaUDPkDKw7CUk16Q,96
15
- mkdocs_include_markdown_plugin-7.3.0.dist-info/licenses/LICENSE,sha256=Fyr5Goos1Rh671K_-S1AC7jTp1ng4xQdFjv-qbmCWLc,11365
16
- mkdocs_include_markdown_plugin-7.3.0.dist-info/RECORD,,
12
+ mkdocs_include_markdown_plugin-7.3.1.dist-info/METADATA,sha256=xjhPn-02aikRWrVLYKhw32q1IL_jfXPJoqA2axi5dnQ,12888
13
+ mkdocs_include_markdown_plugin-7.3.1.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
14
+ mkdocs_include_markdown_plugin-7.3.1.dist-info/entry_points.txt,sha256=WEL5m7sw5ZMBwmdOs5S_9mGoZfLCaUDPkDKw7CUk16Q,96
15
+ mkdocs_include_markdown_plugin-7.3.1.dist-info/licenses/LICENSE,sha256=Fyr5Goos1Rh671K_-S1AC7jTp1ng4xQdFjv-qbmCWLc,11365
16
+ mkdocs_include_markdown_plugin-7.3.1.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: hatchling 1.29.0
2
+ Generator: hatchling 1.33.0
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any