Try to fix markdown links on import

Say I have a directory, and in it the files
a.md
b.md
And a.md contains a link [b](b.md).

If I import the directory to Joplin, the link will break, because in Joplin the files get new random names.

Maybe, when Joplin imports a directory of .md files, it could take the path b.md and make another file, that lists that path as an alias to the relevant Joplin resource. Much like the files that store tags and other metadata.

Now, I don’t know if Joplin saves the original path of imported files (like it does with clipped webpages), but if it does, maybe it could search for correct files previously imported to Joplin, from other directories.

Is there any solution to this issue?

I have a script that creates a whole set of files for school year which are interconnected by links. By importing it to Joplin I would like the links to be replaced by the Joplin links.

Is there a way to solve that by a plugin?