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

uniorg-rehype does not transform internal org links to html links #106

Open
venikx opened this issue Apr 19, 2024 · 0 comments
Open

uniorg-rehype does not transform internal org links to html links #106

venikx opened this issue Apr 19, 2024 · 0 comments

Comments

@venikx
Copy link
Contributor

venikx commented Apr 19, 2024

The following snippets:

[[../index.org]]

Parses it as:

{
  "type": "org-data",
  "contentsBegin": 0,
  "contentsEnd": 16,
  "children": [
    {
      "type": "paragraph",
      "affiliated": {},
      "contentsBegin": 0,
      "contentsEnd": 16,
      "children": [
        {
          "type": "link",
          "format": "bracket",
          "linkType": "file",
          "rawLink": "../index.org",
          "path": "../index.org",
          "children": []
        }
      ]
    }
  ]
}

And returns the following html:

<p><a href="../index.org">../index.org</a></p>

It's my understanding uniorg-rehype is meant to mimic ox-html somewhat, and internal links to org file should resolve to the corresponding html file. I'm currently getting around this via a transformer https://github.com/venikx/venikx.com/blob/main/src/lib/plugins.ts but ideally this should be handled by uniorg-rehype if it wishes to mimic the behavior of ox-html. Another options is to create a rehype plugin that translates all .org links to `.html'.

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