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

feat: transform any anchor element #35

Open
techfg opened this issue Apr 13, 2024 · 0 comments
Open

feat: transform any anchor element #35

techfg opened this issue Apr 13, 2024 · 0 comments

Comments

@techfg
Copy link
Contributor

techfg commented Apr 13, 2024

Currently, the plugin only transforms urls on href for anchor elements that are immediate children of the root node in the tree.

It would be possible to transform any url that points to an md/mdxfile regardless of where it "lives" in the tree and/or what type oftag type` it is.

For example, if the markdown contains the following, the transform will not occur:

This is a manual <a href="./my-post.md">My Post</a> anchor element

A couple of ways this could be approached:

  1. Leave currently functionality as-is, only transform on markdown style links (e.g., my link
  2. Expand to include any href on any anchor element within the document
  3. Expand to include any url

Option 2 & 3 could be baked in or exposed via some test option that allows a function to be passed to determine if the url should be transformed or not.

This is definitely a nice to have I think but wanted to log it for future consideration.

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