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
346 stars 146 forks source link

Inline anchors with the form `[#anchor]#Text to anchor#` do not show up in the list of available anchors #1647

Open RayOffiah opened 2 months ago

RayOffiah commented 2 months ago

Observed vs. expected behavior

When anchoring a piece of inline text like this:

[#anchor]#Text to anchor#

The anchor is not added to the list of valid anchors for the page.

This means that it is flagged as an error (anchor doesn't resolve) and cannot be picked from the list.

Steps to reproduce

Add an anchor to the inline text as described above.

Attempt to create a link.

The anchor does not show up as a possible link.

Workaround

The inline anchor form:

[[anchor]]Text to anchor

works correctly.

Environment

macOS 14.5

Plugin Version: ____

0.42.2

IntelliJ Details: ____

IntelliJ IDEA 2024.2 EAP (Ultimate Edition) Build #IU-242.19890.14, built on July 3, 2024 Licensed to IntelliJ IDEA EAP user: Ray Offiah Expiration date: August 2, 2024 Runtime version: 21.0.3+13-b509.4 x86_64 (JCEF 122.1.9) VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. Toolkit: sun.lwawt.macosx.LWCToolkit macOS 14.5 GC: G1 Young Generation, G1 Concurrent GC, G1 Old Generation Memory: 5192M Cores: 12 Metal Rendering is ON Registry: debugger.new.tool.window.layout=true ide.experimental.ui=true Non-Bundled Plugins: com.jetbrains.plugins.ini4idea (242.19890.20) Batch Scripts Support (1.0.13) Shifter (1.9.6) com.intellij.plugins.watcher (242.19890.14) com.mroche.JsonHelper (1.3.2) com.intellij.mermaid (0.0.22+IJ.232) name.kropp.intellij.makefile (242.19890.14) String Manipulation (9.14.1) org.jetbrains.plugins.go (242.19890.14) com.intellij.ml.llm (242.19890.14) net.seesharpsoft.intellij.plugins.csv (2.21.0) com.intellij.grazie.pro (0.3.314) PlantUML integration (7.10.1-IJ2023.2) org.asciidoctor.intellij.asciidoc (0.42.2) izhangzhihao.rainbow.brackets (2024.2.4-241) com.dmarcotte.handlebars (242.19890.14) com.intellj.plugin.SpringBootBannerPlugin (0.2.9) com.intellij.plugins.html.instantEditing (242.19890.14) Kotlin: 242.19890.14-IJ

ahus1 commented 1 month ago

Thanks for reporting this. I can confirm that those inline anchors are not supported, yet. I'll need to find out how to support those in a future version of the plugin. It might be a bit tricky to add this to the parser.

RayOffiah commented 1 month ago

No worries. 👍🏾

As I said, there is a workaround. 🙂