Skip to content

Commit

Permalink
Fix markdown links to get scanned for URL rewriting as well
Browse files Browse the repository at this point in the history
  • Loading branch information
EricZinda committed Sep 13, 2023
1 parent 31b96d3 commit d42102e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sitescripts/createdocs.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from marko.ext.gfm import GFM
from marko.md_renderer import MarkdownRenderer
from marko.renderer import Renderer
from marko.inline import Link
from marko.inline import Link, Image
import createblanksite


Expand Down Expand Up @@ -147,7 +147,7 @@ def convert_and_copy_doc(repositories_definitions, sites_definitions, pages_defi
# in the new site structure
def convert_child(repositories_definitions, pages_definitions, file_definition, node):
links = []
if isinstance(node, Link):
if isinstance(node, Link) or isinstance(node, Image):
link_data = copy.deepcopy(file_definition)

# Remember the original information in the link
Expand Down
7 changes: 7 additions & 0 deletions sitescripts/testdata/docswiki/ALinkTest.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
![https://github.com/delph-in/erg/blob/main/www/esd/essence/the-cheerful-children-wanted-to-sing-and-dance.png](https://github.com/delph-in/erg/blob/main/www/esd/essence/the-cheerful-children-wanted-to-sing-and-dance.png "https://github.com/delph-in/erg/blob/main/www/esd/essence/the-cheerful-children-wanted-to-sing-and-dance.png")


These are all examples of links that appear in the wild in the wiki, some need to be fixed, some are legit.


Expand All @@ -18,6 +21,10 @@ These should stay the same:
[/delph-in/erg/blob/main/www/esd/the-garden-dog-tried-not-to-bark.png?raw=true](/delph-in/erg/blob/main/www/esd/the-garden-dog-tried-not-to-bark.png?raw=true)

These should get "raw=true" added to its query:
<img src="https://github.com/delph-in/erg/blob/main/www/esd/essence/the-cheerful-children-wanted-to-sing-and-dance.png" title="https://github.com/delph-in/erg/blob/main/www/esd/essence/the-cheerful-children-wanted-to-sing-and-dance.png" class="external_image" alt="https://github.com/delph-in/erg/blob/main/www/esd/essence/the-cheerful-children-wanted-to-sing-and-dance.png" />
![https://github.com/delph-in/erg/blob/main/www/esd/essence/the-cheerful-children-wanted-to-sing-and-dance.png](https://github.com/delph-in/erg/blob/main/www/esd/essence/the-cheerful-children-wanted-to-sing-and-dance.png "https://github.com/delph-in/erg/blob/main/www/esd/essence/the-cheerful-children-wanted-to-sing-and-dance.png")


[https://github.com/delph-in/erg/blob/main/www/esd/the-garden-dog-tried-not-to-bark.png](https://github.com/delph-in/erg/blob/main/www/esd/the-garden-dog-tried-not-to-bark.png)
[/delph-in/erg/blob/main/www/esd/the-garden-dog-tried-not-to-bark.png](/delph-in/erg/blob/main/www/esd/the-garden-dog-tried-not-to-bark.png)

Expand Down

0 comments on commit d42102e

Please sign in to comment.