Bulk changing markdown paths to allow proper rendering

While creating my library I added a subfolder from a downloaded git repository containing numerous documentation files in markdown format along with many images linked from the markdown docs. When viewing the docs in DT3 I notice the image links are broken. Researching shows the folder structure is imported as groups but the files themselves are actually placed seemingly randomly into indexed buckets on the file system internal to the DT DB. For example, the git repo has all images in a folder named _assets and one of the images is named 1.3_alternative.png but at the file system level the image is actually in a folder Files.noindex/png/5 so the markdown rendering is broken.

Is there any way around this? I understand DT reorders internally but is there any script that can go through all markdown files in a group and modify the image paths to point to the actual file paths, automatically? Or from the DT team is there any way to have the markdown renderer correctly link to images using group paths instead of file paths?

Note I’m not manually building these, I imported them from a git repo. Manually updating each markdown file is impractical, there are over 250 pages and over 600 images in this documentation package.

Thanks.

Screencaps of a link in the Markdown as well the one showing the location of the file would be helpful.

Ok. There will be a lot of replies since I can only post one image per post.

Markdown that fails to render the image:

image

Rendering in DT3:

image

Markdown file in DT group structure:

image

(image is in the _assets group at the top)

Markdown file location:

image

PNG file location:

image

Strangely enough, several other Markdown files reference PNG files in a “local” folder named images contained in the same group as the MD file itself, and they render just fine.

For example, in the agile group, markdown file 2-2-introduction.md renders just fine:

image

2-2-introduction.md source:

image

A double dot structure in the path is not supported.
If assets is at the root of the database /assets/someImage.png would work. Otherwise, a more complete path would be required, like /projects/myProject/_assets/someImage.png

The files in the images directory works since it’s a relative path. The images are in a subfolder the Markdown is contained within, so images/someImage.png links to the images in the subfolder.

As far as fixing this, it’s possible to script but it depends on the actual files and paths involved.

PS: You would not and should not link to the files in the filesystem within a DEVONthink database. That is not necessarily a static file location.