asciidoctor / kramdown-asciidoc

A kramdown extension for converting Markdown documents to AsciiDoc.
Other
207 stars 19 forks source link

converting markdown into AsciiDoc - wrong conversion of links #107

Closed aisbergde closed 2 years ago

aisbergde commented 2 years ago

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

https://github.com/asciidoctor/asciidoctor-intellij-plugin/issues/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

mojavelinux commented 2 years ago

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

aisbergde commented 2 years ago

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

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?

aisbergde commented 2 years ago

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).

mojavelinux commented 2 years ago

To my knowledge, the IntelliJ Plugin doesn't even use Kramdown AsciiDoc. See https://github.com/asciidoctor/asciidoctor-intellij-plugin/issues/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.

mojavelinux commented 2 years ago

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.

mojavelinux commented 2 years ago

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.

aisbergde commented 2 years ago

I will ask in the chat.