Skip to content

Fix formatting of markup in the docs for WP_HTML_Tag_Processor#4419

Closed
johnbillion wants to merge 1 commit intoWordPress:trunkfrom
johnbillion:tag-processor-docs
Closed

Fix formatting of markup in the docs for WP_HTML_Tag_Processor#4419
johnbillion wants to merge 1 commit intoWordPress:trunkfrom
johnbillion:tag-processor-docs

Conversation

@johnbillion
Copy link
Copy Markdown
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:

@johnbillion johnbillion requested review from adamziel and azaozz May 3, 2023 19:42
Copy link
Copy Markdown
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
Copy Markdown
Member Author

@johnbillion johnbillion closed this May 3, 2023
@dmsnell
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Member Author

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

@dmsnell
Copy link
Copy Markdown
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