Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Anchor links are not working without explicit path specification #55

Open
slavafomin opened this issue Aug 8, 2016 · 0 comments
Open

Comments

@slavafomin
Copy link

slavafomin commented Aug 8, 2016

Hello!

Thank you for this great library!

However, it looks like anchor links are not working without explicit path specification.

For example, I have this code in my index.md:

# Introduction

Also see [pagination](#pagination).

# Pagination

Most of the requests which return list of items support pagination.

When I try to compile it, I'm getting the error:

Could not parse metadata from /src/index.md
path.js:7
    throw new TypeError('Path must be a string. Received ' + inspect(path));
    ^

TypeError: Path must be a string. Received null
    at assertPath (path.js:7:11)
    at Object.extname (path.js:1433:5)
    at Renderer.renderer.link (.../node_modules/markdown-styles/lib/convert-md.js:58:22)
    at InlineLexer.outputLink (.../node_modules/markdown-styles/node_modules/marked/lib/marked.js:707:21)
    at InlineLexer.output (.../node_modules/markdown-styles/node_modules/marked/lib/marked.js:622:19)
    at Parser.tok (.../node_modules/markdown-styles/node_modules/marked/lib/marked.js:1075:50)
    at Parser.parse (.../node_modules/markdown-styles/node_modules/marked/lib/marked.js:935:17)
    at DestroyableTransform._transform (.../node_modules/markdown-styles/node_modules/markdown-stream-utils/lib/convert-md.js:11:28)
    at DestroyableTransform.Transform._read (.../node_modules/markdown-styles/node_modules/readable-stream/lib/_stream_transform.js:184:10)
    at DestroyableTransform.Transform._write (.../node_modules/markdown-styles/node_modules/readable-stream/lib/_stream_transform.js:172:12)

However, when I specify it like this: Also see [pagination](./#pagination)., it compiles correctly but leads out of index.html file to the root of the directory. The only working solution is to write it this way: Also see [pagination](./index.html#pagination)., but it's cumbersome and not very DRY.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant