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 formatting of markup in the docs for WP_HTML_Tag_Processor #4419

Closed
wants to merge 1 commit into from

Conversation

johnbillion
Copy link
Member

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:

Copy link
Contributor

@adamziel adamziel left a 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

@johnbillion
Copy link
Member Author

@johnbillion johnbillion closed this May 3, 2023
@dmsnell
Copy link
Member

dmsnell commented May 4, 2023

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.

@dmsnell
Copy link
Member

dmsnell commented May 4, 2023

@johnbillion what was wrong with the U+FFFD note?
looks right to me in the linked documentation, which I think is still reflecting the code before this change

Screenshot 2023-05-04 at 10 43 42 AM

@johnbillion
Copy link
Member Author

I was under the impression the indentation was required

Yeah you just need either the backticks or the indentation but not both 😄

what was wrong with the U+FFFD note?

It was just to remove the unprintable character from the source code 👍

looks right to me in the linked documentation

Yeah the docs on the developer reference site only get regenerated from the source when each new version of WordPress is released

@dmsnell
Copy link
Member

dmsnell commented May 4, 2023

but not both

ahaa

It was just to remove the unprintable character from the source code 👍

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 U+FFFD

@johnbillion
Copy link
Member Author

Ohhhh that is the actual unicode character displayed as a replacement when a character is unprintable? I see.

@dmsnell
Copy link
Member

dmsnell commented May 4, 2023

@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

dmsnell added a commit to WordPress/gutenberg that referenced this pull request May 4, 2023
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)
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.

3 participants