asciidoctor / kramdown-asciidoc

A kramdown extension for converting Markdown documents to AsciiDoc.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

converting markdown into AsciiDoc - wrong conversion of links

aisbergde opened this issue · comments

the original issue was here, but I think, it is a kramdown-asciidoc issue

asciidoctor/asciidoctor-intellij-plugin#1170

Here is the original post

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

The AsciiDoc output looks exactly right to me. It's true that kramdown assumes idprefix= and idseparator=- will be set on the AsciiDoc processor by default. If this is not the case, you can control how IDs are generated using the --auto-id* options. See https://github.com/asciidoctor/kramdown-asciidoc#auto-generate-ids

anyway the generated adoc doesn't work in preview.
it doesn't work

  • in the idea Plugin preview
  • in the VSC preview
  • when I render the generated adoc in a browser using the AsciiDoc plugin

I don't understand, why the issue was closed.
Because I don't know the solution for the issue.

My expectation of kramdown would be that the adoc files created work as is. In different previews.

But maybe the conversion is correct, and the browser extension is buggy? Do I have to report the bug there now?

Or what should I do to get such adoc documents during the conversion with kramdown, in which the links work in the preview?

If some specific attributes are required for kramdown:
should they be used in the idea plugin?
So is it finaly an idea plugin bug?

I just want to know, how I could solve the issue (which is an issue for me).

To my knowledge, the IntelliJ Plugin doesn't even use Kramdown AsciiDoc. See asciidoctor/asciidoctor-intellij-plugin#257 So that would be the first thing that would have to happen.

Based on the output the IntelliJ Plugin is currently producing, you can add these lines to the generated file:

:idprefix:
:idseperator: -

You could also add them to the project or global AsciiDoc config in the plugin.

I don't understand, why the issue was closed.

Because a) it has nothing to do with this project and b) I have already documented how to control the ID generation using Kramdown AsciiDoc. So it's not an issue.

It would also be better to ask questions such as this in the project chat. That's what the project chat is for. The issue tracker is for reporting known problems that need to be addressed in the software. The nature of your post is still exploratory.

I will ask in the chat.