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

Text format - add auto heading ids to WYSIWYG text format. #142

Closed
finnlewis opened this issue Feb 5, 2024 · 4 comments
Closed

Text format - add auto heading ids to WYSIWYG text format. #142

finnlewis opened this issue Feb 5, 2024 · 4 comments
Assignees

Comments

@finnlewis
Copy link
Member

We've moved to paragraphs in the publication content.

This means we cannot set our custom input format which would include the auto heading ids plugin.

Discussing with @rupertj , we think the best thing to do it add a hook_install or similar to add the plugin to the existing WYSIWYG text format.

This will be altering existing config, but will only result in adding ids (if not already present) to headings, which might have other benefits (@msayoung ?).

CC @andybroomfield and @willguv for awareness and comment.

Passing to you @rupertj to implement, such that we can have a table of contents on a fresh install.

@andybroomfield
Copy link
Contributor

This would be layout paragraphs, so using the localgov_paragraphs?
It makes sense to have a single editor format for consistency.
Does auto heading IDs conflict with anchor link?

@rupertj
Copy link
Member

rupertj commented Feb 6, 2024

So it looks like aurto heading IDs will overwrite existing IDs, which is annoying. I just put this markup in a publications page:

<h2 id="something-else">This is another header</h2>

And got this out:

<h2 id="this-is-another-header">This is another header</h2>

So I don't think we could roll this out everywhere as-is. We'd either need to change the module to stop it overwriting existing IDs, or make our own filter that works like that.

@finnlewis
Copy link
Member Author

@rupertj is suggesting we improve the plugin to NOT override existing id's in headings. We could then inclide our own version of this plugin in localgov_publications or improve the plugin at https://www.drupal.org/project/auto_heading_ids

@rupertj
Copy link
Member

rupertj commented Feb 28, 2024

Closing this as it's merged :)

@rupertj rupertj closed this as completed Feb 28, 2024
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

3 participants