Skip to content

Can't export Link style correctly in html format #1822

Description

@YsuOS

Prerequisites

  • I am using the latest stable release of Neovim
  • I am using the latest version of the plugin

Neovim Version

0.11.6

Neorg setup

require("neorg").setup({
load = {
["core.defaults"] = {},
["core.concealer"] = {},
["core.dirman"] = {
config = {
workspaces = {
norg = "~/norg",
},
default_workspace = "norg",
},
},
["core.export"] = {},
["core.export.markdown"] = {},
["core.export.html"] = {},
},
})

Actual behavior

We can't export {URL}[description] correctly into html format.

  @code 
* HTML export test
  - {https://example.link.com}[Link style]
  @end
  - Run `:Neorg export to-file test.html`
  @code
...
<li>

<a href="https://example.link.com">https://example.link.com</a>
</li>
...
  @end

Expected behavior

  @code
...
<li>

<a href="https://example.link.com">Link style</a>
</li>
...
</ul>

</div>
  @end

Steps to reproduce

  • Prepare the following norg file.
  @code 
* HTML export test
  - {https://example.link.com}[Link style]
  @end
  • Run :Neorg export to-file test.html
  • Check the test.html

Potentially conflicting plugins

No response

Other information

* Test result
  - test norg file.
  @code
* HTML export test
  - {https://example.link.com}[Link style]
  - [Anchor style]{https://example.anchor.com}
  - {https://example.no_desc.com}
  - [header]{# HTML export test}
  @end
  - Actual result: Link style does not work correctly.
  @code
<div>
<h1 id="heading1-htmlexporttest"><span id="generic-htmlexporttest"></span>HTML export test</h1>
<ul>

<li>

<a href="https://example.link.com">https://example.link.com</a>
</li>

<li>

<a href="https://example.anchor.com">Anchor style</a>
</li>

<li>

<a href="https://example.no_desc.com">https://example.no_desc.com</a>
</li>

<li>

<a href="#generic-htmlexporttest">header</a>
</li>

</ul>

</div>
  @end
  @code 
in wrap_anchor()

vim.print(output)
vim.print(state.link)
local content
...
  @end
  - The output is unreliable since the order of output is differ in each link and anchor style. 
  @code
{ "https://example.link.com", "Link style" }
{
  link_description = "Link style",
  link_location_text = "https://example.link.com",
  link_node = <userdata 1>,
  link_type = "url"
}
{ "Anchor style", "https://example.anchor.com" }
{
  link_description = "Anchor style",
  link_location_text = "https://example.anchor.com",
  link_node = <userdata 1>,
  link_type = "url"
}
{ "https://example.no_desc.com" }
{
  link_location_text = "https://example.no_desc.com",
  link_node = <userdata 1>,
  link_type = "url"
}
{ "header", "HTML export test" }
{
  link_description = "header",
  link_location_text = "HTML export test",
  link_node = <userdata 1>,
  link_type = "generic"
}
  @end
  - After update
  @code
<div>
<h1 id="heading1-htmlexporttest"><span id="generic-htmlexporttest"></span>HTML export test</h1>
<ul>

<li>

<a href="https://example.link.com">Link style</a>
</li>

<li>

<a href="https://example.anchor.com">Anchor style</a>
</li>

<li>

<a href="https://example.no_desc.com">https://example.no_desc.com</a>
</li>

<li>

<a href="#generic-htmlexporttest">header</a>
</li>

</ul>

</div>
  @end

Help

None

Implementation help

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssues related to bugs. Please attach a severity, a priority and category with this label.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions