Skip to content

[orgmode] Fragment Identifier Stripped from Links #446

@Xaldew

Description

@Xaldew

Given the following org-mode test post:

#+BEGIN_COMMENT
.. title: Test
.. slug: test
.. date: 2024-10-27 15:54:05 UTC+02:00
.. tags:
.. category:
.. link:
.. description:
.. type: text

#+END_COMMENT

* Introduction

Test link: [[link:/pages/publications/#pub0][Test]].

When this is exported converted/exported to HTML, the fragment identifier (#pub0 above) is removed from the link. As far as I have been able to tell, creating the 'partial' HTML file directly from Emacs works fine, and contains the correct HTML link:

<div id="outline-container-org9106939" class="outline-2">
<h2 id="org9106939">Introduction</h2>
<div class="outline-text-2" id="text-org9106939">
<p>
Test link: <a href="link:/pages/publications/#pub0">Test</a>.
</p>
</div>
</div>

Thus, I don't think anything is wrong with the plugin itself, but there could be some machinery I'm missing. Does Nikola perform any other kind of fix-ups on the <a> tags after a plugin is done with it that may strip out the fragments?

Also, is there some way to retrieve the partial HTML generated by the plugin before they're converted to full HTML pages in the output directory? That would help immensely with debugging this

For reference, the snippet generated by Nikola + the org-mode plugin is this:

    <div id="outline-container-org41a0786" class="outline-2">
<h2 id="org41a0786">Introduction</h2>
<div class="outline-text-2" id="text-org41a0786">
<p>
Test link: <a href="/pages/publications/">Test</a>.
</p>
</div>
</div>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions