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

Relative paths in html anchors #769

Closed
nojaf opened this issue Aug 31, 2022 · 4 comments · Fixed by #772
Closed

Relative paths in html anchors #769

nojaf opened this issue Aug 31, 2022 · 4 comments · Fixed by #772

Comments

@nojaf
Copy link
Collaborator

nojaf commented Aug 31, 2022

Somewhat related to #764.
If the links are defined inside <a> tags in Markdown, they are not transformed to their .html counterparts.

We typically use:

<div class="d-flex justify-content-between my-4">
  <a href="./GettingStarted.html">Previous</a>
  <a href="./Configuration.html">Next</a>
</div>

to get around this.
Preferably we can write <a href="./GettingStarted.md">Previous</a> as well here.

@nojaf
Copy link
Collaborator Author

nojaf commented Aug 31, 2022

Initial guess, with some more processing in

| InlineHtmlBlock (code, count, range) -> InlineHtmlBlock(mapText f code, count, range)

we can achieve this? If this is the case, would you accept a PR?

@dsyme
Copy link
Contributor

dsyme commented Aug 31, 2022

That seems quite hard to arrange - it would mean parsing arbitrary HTML. We could use a heuristic but it feels like a slippery slope

@nojaf
Copy link
Collaborator Author

nojaf commented Aug 31, 2022

Yes, I do have in mind to parse the HTML as an XmlElement and look for //a/@href[ends-with('.md')] (or similar) xpath selector.

@dsyme
Copy link
Contributor

dsyme commented Sep 3, 2022

That's reasonable, yes

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

Successfully merging a pull request may close this issue.

2 participants