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

fix: using configured id prefix for anchor links #95

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Muetze42
Copy link

@Muetze42 Muetze42 commented Nov 5, 2024

No description provided.

@benbjurstrom
Copy link
Owner

I like the idea, but isn't the config key prezet.commonmark.config.heading_permalink.id_prefix?

This file would also need an update:

$fragment = $this->section ? "#content-{$fragment}" : '';

Finally, I'm not sure we need the static getter method. I'd just hardcode the dash as a separator like this:

$idPrefix = config('prezet.commonmark.config.heading_permalink.id_prefix');
$result[] = [
                'id' => $idPrefix.'-'.Str::slug($h2Element->textContent, language: null),
...

@Muetze42
Copy link
Author

Muetze42 commented Nov 6, 2024

The links on the right side did not work without this change.

But you can also just close it, as I don't use the package after all.

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

Successfully merging this pull request may close these issues.

2 participants