mkdocs-include-markdown-plugin 7.1.5__py3-none-any.whl → 7.1.6__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.
@@ -291,7 +291,7 @@ def rewrite_relative_urls(
291
291
  ``destination_path``.
292
292
  """
293
293
  def rewrite_url(url: str) -> str:
294
- if is_url(url) or is_absolute_path(url):
294
+ if is_url(url) or is_absolute_path(url) or is_anchor(url):
295
295
  return url
296
296
 
297
297
  new_path = os.path.relpath(
@@ -583,6 +583,17 @@ def is_absolute_path(string: str) -> bool:
583
583
  return False
584
584
 
585
585
 
586
+ def is_anchor(string: str) -> bool:
587
+ """Check if a string looks like an anchor.
588
+
589
+ An anchor is a string that starts with `#` and is not a relative path.
590
+ """
591
+ try:
592
+ return string[0] == '#'
593
+ except IndexError: # pragma: no cover
594
+ return False
595
+
596
+
586
597
  def read_file(file_path: str, encoding: str) -> str:
587
598
  """Read a file and return its content."""
588
599
  f = open(file_path, encoding=encoding) # noqa: SIM115
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mkdocs-include-markdown-plugin
3
- Version: 7.1.5
3
+ Version: 7.1.6
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
@@ -6,10 +6,10 @@ mkdocs_include_markdown_plugin/event.py,sha256=oGqRynhbdppShg4sJTwGKwp84_ZNdExzg
6
6
  mkdocs_include_markdown_plugin/files_watcher.py,sha256=hu-63u8syl00mXP59vP_iqD7T1R9iU9JjiZOHDV5fas,298
7
7
  mkdocs_include_markdown_plugin/logger.py,sha256=nl63G4IJSt5mEYHbObuh7BmmowSv-aa1l_v9I257570,230
8
8
  mkdocs_include_markdown_plugin/plugin.py,sha256=0muHIhmklC7v-QKWsAcAtZKhhZQ2olH6b28b3_3e4gI,3850
9
- mkdocs_include_markdown_plugin/process.py,sha256=35aiwf0cdMBneKRouJexKWB9ZlMcd7FFy74A7lCCt30,20383
9
+ mkdocs_include_markdown_plugin/process.py,sha256=EWAYGCtD1gY3yvqvBZxD4HL49cqdB3B8lujoKsD9J0U,20675
10
10
  mkdocs_include_markdown_plugin/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
- mkdocs_include_markdown_plugin-7.1.5.dist-info/METADATA,sha256=l0fIrWq1JIeRaUVaDw-wuUqH6pA3c5HC7MuGppW3yUM,12770
12
- mkdocs_include_markdown_plugin-7.1.5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
13
- mkdocs_include_markdown_plugin-7.1.5.dist-info/entry_points.txt,sha256=WEL5m7sw5ZMBwmdOs5S_9mGoZfLCaUDPkDKw7CUk16Q,96
14
- mkdocs_include_markdown_plugin-7.1.5.dist-info/licenses/LICENSE,sha256=qm1MNzU_lIANFB-1cBpD9hqdD_Htv3_Xr6hobt0IHq8,11365
15
- mkdocs_include_markdown_plugin-7.1.5.dist-info/RECORD,,
11
+ mkdocs_include_markdown_plugin-7.1.6.dist-info/METADATA,sha256=XxLA7Z8QvunAsGDr_eb2ukbe57hFahVTYYwTXqllAuw,12770
12
+ mkdocs_include_markdown_plugin-7.1.6.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
13
+ mkdocs_include_markdown_plugin-7.1.6.dist-info/entry_points.txt,sha256=WEL5m7sw5ZMBwmdOs5S_9mGoZfLCaUDPkDKw7CUk16Q,96
14
+ mkdocs_include_markdown_plugin-7.1.6.dist-info/licenses/LICENSE,sha256=qm1MNzU_lIANFB-1cBpD9hqdD_Htv3_Xr6hobt0IHq8,11365
15
+ mkdocs_include_markdown_plugin-7.1.6.dist-info/RECORD,,