Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression in [anchor] shortcode #32

Open
yankl opened this issue Dec 8, 2023 · 0 comments
Open

Regression in [anchor] shortcode #32

yankl opened this issue Dec 8, 2023 · 0 comments

Comments

@yankl
Copy link
Contributor

yankl commented Dec 8, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant