-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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 formatting of markup in the docs for WP_HTML_Tag_Processor
#4419
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking great, thanks! Also cc @dmsnell
Thanks @johnbillion - I was under the impression the indentation was required, but I've double-checked after this change and the code still renders as code at least in PHPStorm and VSCode. |
@johnbillion what was wrong with the U+FFFD note? |
Yeah you just need either the backticks or the indentation but not both 😄
It was just to remove the unprintable character from the source code 👍
Yeah the docs on the developer reference site only get regenerated from the source when each new version of WordPress is released |
ahaa
that character is printable though, and it printed maybe it's confusing because that character is the character used when the string has invalid characters in it? I think maybe it was a mistake to remove. we added that originally to show what it is, thinking people would more readily recognize � than |
Ohhhh that is the actual unicode character displayed as a replacement when a character is unprintable? I see. |
@johnbillion do you have any thoughts about me adding it back in? maybe surround it in quotes this time to try and make it more obvious that it's the actual character? sorry this wasn't caught in review. I would have noted it, but the PR was created and merged while I was still asleep |
In this "blessed" patch we're backporting some udpates coming from Core in the Tag Processor, namely a major fix to a rare bug that occurs when making changes and then seeking to an earlier position in a document. - Preserve internal cursor across updates [#4371](WordPress/wordpress-develop#4371) - Update code example formatting to fix Developer Resources docs [#4419](WordPress/wordpress-develop#4419) - Update whitespace formatting to pass Gutenberg linter [#4433](WordPress/wordpress-develop#4422)
Trac ticket: https://core.trac.wordpress.org/ticket/57840
There's many helpful code examples in the docs for the
WP_HTML_Tag_Processor
class but they're all indented by four unnecessary spaces. They use the```php
wrapper which makes the indentation appear in the code blocks on the developer reference site. This fixes that by removing the extraneous indentation.There's also an additional fix for the note about the
U+FFFD
character.Example URLs that display the unnecessary indentation: