Skip to content

Regression in [anchor] shortcode #32

Description

@yankl

Using the sample code in the readme:

Ut sed nisl suscipit metus sollicitudin [anchor]<span>ornare</span>[/anchor] nec vitae nulla. In pretium massa ex, in [anchor="vulputate"]vulputate tellus[/anchor] accumsan vel. 

Nullam [anchor id="tempor"]tempor quis lorem[/anchor] venenatis finibus. Curabitur dapibus nulla sed tristique pretium. Nullam tempor quis [anchor prefix="sec2.2-"]lorem venenatis finibus[/anchor].

This is the HTML output I get in v. 3.2.2

<p>Ut sed nisl suscipit metus sollicitudin <a id="" href="#" class="inline-anchor" aria-label="Anchor"><span>ornare</span></a> nec vitae nulla. In pretium massa ex, in <a id="vulputate" href="#vulputate" class="inline-anchor" aria-label="Anchor">vulputate tellus</a> accumsan vel. </p>
<p>Nullam <a id="tempor" href="#tempor" class="inline-anchor" aria-label="Anchor">tempor quis lorem</a> venenatis finibus. Curabitur dapibus nulla sed tristique pretium. Nullam tempor quis <a id="sec2.2-" href="#sec2.2-" class="inline-anchor" aria-label="Anchor">lorem venenatis finibus</a>.</p>

As opposed to v. 3.0.0 when the feature was introduced:

<body id="toc_generator_6572fb87d779b"><p>Ut sed nisl suscipit metus sollicitudin <a id="ornare" href="#ornare" class="inline-anchor" aria-label="Anchor"><span>ornare</span></a> nec vitae nulla. In pretium massa ex, in <a id="vulputate" href="#vulputate" class="inline-anchor" aria-label="Anchor">vulputate tellus</a> accumsan vel. </p>
<p>Nullam <a id="tempor" href="#tempor" class="inline-anchor" aria-label="Anchor">tempor quis lorem</a> venenatis finibus. Curabitur dapibus nulla sed tristique pretium. Nullam tempor quis <a id="sec2.2-lorem-venenatis-finibus" href="#sec2.2-lorem-venenatis-finibus" class="inline-anchor" aria-label="Anchor">lorem venenatis finibus</a>.</p></body>

Evidently, the no-options and prefix variants are not picking up the text from inside the shortcode.
I'm using Grav v1.7.43 - PHP 8.3.0.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions