asciidoctor / asciidoctor-intellij-plugin

AsciiDoc plugin for products on the IntelliJ platform (IDEA, RubyMine, etc)
https://intellij-asciidoc-plugin.ahus1.de/
Apache License 2.0
355 stars 145 forks source link

converting markdown into AsciiDoc - wrong conversion of links #1170

Open aisbergde opened 2 years ago

aisbergde commented 2 years ago

Observed vs. expected behavior

After converting markdown into Adoc the plugin shows errors.

Original (markdown)

What we're looking at today:

*   [Obsidian](#obsidian)
*   [GitJournal](#gitjournal)
*   [Markor](#markor)
*   [iA Writer](#ia-writer)
*   [Other apps of interest](#other-apps-of-interest)
    *   [Markdown notes](#markdown-notes)
    *   [Git clients](#git-clients)
*   [Last thoughts](#final-thoughts)

Obsidian
--------

converted (adoc)

What we're looking at today:

* <<obsidian,Obsidian>>
* <<gitjournal,GitJournal>>
* <<markor,Markor>>
* <<ia-writer,iA Writer>>
* <<other-apps-of-interest,Other apps of interest>>
** <<markdown-notes,Markdown notes>>
** <<git-clients,Git clients>>
* <<final-thoughts,Last thoughts>>

== Obsidian

image

but this would work:

* <<iA Writer>>
* <<Other apps of interest>>

maybe it would be better to assign explicit anchor id to section titles:

[#obsidian]
== Obsidian

I think, the conversion mixes natural cross reference with another kind of anchoring

aisbergde commented 2 years ago

I think this is a kramdown error, kramdown also generates wrong content

ahus1 commented 2 years ago

The conversion in this plugin is done via https://github.com/bodiam/markdown-to-asciidoc and not kramdown.

I see that this was discussed in the kramdown project, and that the other issue now closed. I close this one as well as I assume the settings about how to generate IDs would apply here as well.

mojavelinux commented 2 years ago

I assume the settings about how to generate IDs would apply here as well.

Partially. It's true that you could adjust idprefix and idseparator once the Markdown document is converted so that the AsciiDoc processor generates IDs that conform. However, markdown-to-asciidoc does not support control over ID generation coming from the Markdown document as kramdoc provides.

aisbergde commented 2 years ago

for the plugin I have not yet a solution, because I can't set any paramerts, but I can click only the context menu item.

ahus1 commented 2 years ago

Thanks for the comments, I re-open the issue. Still, I don't have a solution for that at hand.