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

Verify fragments #4

Open
ctm opened this issue Feb 6, 2019 · 1 comment
Open

Verify fragments #4

ctm opened this issue Feb 6, 2019 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@ctm
Copy link
Owner

ctm commented Feb 6, 2019

If a location ends with #fragment, then there needs to be corresponding Markdown code in the location file that will generate the fragment anchor. Adding a consistency check for this would be nice.

@ctm
Copy link
Owner Author

ctm commented Feb 6, 2019

In theory, since mdck is already parsing all the markdown files to look for broken links, it should be trivial to also keep track of the anchors that are generated by the various headers encountered. Unfortunately, the algorithm for translating from header text to an anchor is not documented. It is, however, implemented in comrak, although that functionality isn't exposed in a standalone manner, instead it's part of the code that generates HTML.

One possibility I'm pursuing is to have comrak expose that functionality. As such, I'll go ahead and implement fragment verification while that issue is being considered and then finalize my implementation once a decision has been made.

FWIW, I had already looked into (and started playing around) this issue before #2 was requested. I think #2 is actually a more useful feature (especially since it was requested by an actual user), but much of the underlying change to support fragment verification will also allow me to implement #2, so for all practical purposes I'm working on both of them in parallel (although admittedly I'd finish #2 sooner if I hadn't been distracted by a bunch of fragment edge cases).

@ctm ctm self-assigned this Feb 6, 2019
@ctm ctm added the enhancement New feature or request label Feb 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant