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

Adding footnotes mangles all Code Block Pro blocks #329

Open
wadetregaskis opened this issue Jul 15, 2024 · 7 comments
Open

Adding footnotes mangles all Code Block Pro blocks #329

wadetregaskis opened this issue Jul 15, 2024 · 7 comments

Comments

@wadetregaskis
Copy link

wadetregaskis commented Jul 15, 2024

Whenever a footnote is added, all Code Block Pro blocks on the page mangle their contents, replacing actual line returns with the literal text <br>.

This has been happening for a while (months or more), but I feel like it didn't always happen.

WordPress 6.5.5 with Code Block Pro 1.26.4 currently.

@KevinBatdorf
Copy link
Owner

Are you adding something within the code block or outside in another block?

A <br> should not render as a new line within the code block.

Am I understanding it correctly? Do you have a URL or a screenshot?

@wadetregaskis
Copy link
Author

That's correct.

The footnote is added outside the code block. e.g.:


Before

If I now place the cursor after the word "etc" and insert a footnote, it immediately becomes:


After

Worse, this cannot be undone (the undo arrow in the WordPress toolbar is enabled but does nothing when clicked, and likewise ⌘Z does nothing).

@KevinBatdorf
Copy link
Owner

Is the footnote block a plugin? Maybe I can debug what's going on if I reproduce it.

@wadetregaskis
Copy link
Author

It's built into WordPress (since version 6.3).

@KevinBatdorf
Copy link
Owner

Okay I thought so but couldn't find it. I'll look into it and follow up when i figure out what's going on.

@KevinBatdorf
Copy link
Owner

Looks like this broke in 6.5 specifically. I'll need to debug some more to see if there's something I can do to intercept their code. It seems like they are re-injecting the block but mangling the formatting. Further, like you mention, it doesn't add to the edit history. Might need to patch the footnotes block, which could take time.

For now, maybe you can add the footnotes before the blocks? I know that's not very convenient but I can't think of any other temporary workaround.

@wadetregaskis
Copy link
Author

Yeah, that's essentially what I've been trying to do.

Thanks for looking into it. Is it a WordPress bug? It sounds like it shouldn't be mucking with your plug-in's block.

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

2 participants