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

Use WP HTML Tag processor instead of regex #10

Open
mattheu opened this issue Oct 2, 2024 · 0 comments
Open

Use WP HTML Tag processor instead of regex #10

mattheu opened this issue Oct 2, 2024 · 0 comments

Comments

@mattheu
Copy link
Member

mattheu commented Oct 2, 2024

This plugin uses Regex to parse the content and extract headings. I think it would be neat to use the tag processor API instead for the following reasons.

  • More robust than parsing HTML with regex.
  • Allows us to easily manipulate the elements to add attributes. Currently we replace the whole tag with a new tag we've constructed - the problem doing this is that unsupported attributes aren't re-applied. I patched this for styles... but there could be others.
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