npm / marky-markdown

npm's markdown parser
https://www.npmjs.com/package/@npmcorp/marky-markdown
405 stars 72 forks source link

feat: handle subdirectories when building relative link URLs #435

Closed ajafff closed 5 years ago

ajafff commented 5 years ago

This fixes an issue with relative links in packages maintained in a monorepo (described at https://npm.community/t/relative-link-in-readme-of-monorepo/3806)

You basically set repository.url in package.json to the subdirectory that contains the sources of the package. In my case that's https://github.com/fimbullinter/wotan/tree/master/packages/mimir All relative links are relative to that URL. Absolute links are relative to the repository root.

Previously it would always append /blob/HEAD/<link> after the full URL.

ajafff commented 5 years ago

CI failures look unrelated to the changes in this PR

ajafff commented 5 years ago

This is now supported using repository.directory in package.json

johnemau commented 4 years ago

This is now supported using repository.directory in package.json

Although @ajafff's comment implies this issue was fixed by setting respositoy.directoy in the package.json I do not see any implementation and the issue is still reproducing for me.

I see the examples provided before are now using fully qualified URLs to the github resource as a workaround.