WordPress / WordPress/phpdoc-parser
Some characters are stripped from documentation
Open
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 239
- Forks
- 81
- Avg merge
- 16h 29m
- Merged PRs (30d)
- 8
Description
For example, wp_is_valid_utf8() includes this example text:
true === wp_is_valid_utf8( '' );
true === wp_is_valid_utf8( 'just a test' );
true === wp_is_valid_utf8( "\xE2\x9C\x8F" ); // Pencil, U+270F.
true === wp_is_valid_utf8( "\u{270F}" ); // Pencil, U+270F.
true === wp_is_valid_utf8( '' ); // Pencil, U+270F.
false === wp_is_valid_utf8( "just xC0 test" ); // Invalid bytes.
false === wp_is_valid_utf8( "\xE2\x9C" ); // Invalid/incomplete sequences.
false === wp_is_valid_utf8( "\xC1\xBF" ); // Overlong sequences.
false === wp_is_valid_utf8( "\xED\xB0\x80" ); // Surrogate halves.
false === wp_is_valid_utf8( "B\xFCch" ); // ISO-8859-1 high-bytes.
// E.g. The “ü” in ISO-8859-1 is a single byte 0xFC,
// but in UTF-8 is the two-byte sequence 0xC3 0xBC.
However, the documented example is this:
true === wp_is_valid_utf8( '' );
true === wp_is_valid_utf8( 'just a test' );
true === wp_is_valid_utf8( "\xE2\x9C\x8F" ); // Pencil, U+270F.
true === wp_is_valid_utf8( "\u{270F}" ); // Pencil, U+270F.
true === wp_is_valid_utf8( '✏' ); // Pencil, U+270F.
false === wp_is_valid_utf8( "just \xC0 test" ); // Invalid bytes.
false === wp_is_valid_utf8( "\xE2\x9C" ); // Invalid/incomplete sequences.
false === wp_is_valid_utf8( "\xC1\xBF" ); // Overlong sequences.
false === wp_is_valid_utf8( "\xED\xB0\x80" ); // Surrogate halves.
false === wp_is_valid_utf8( "B\xFCch" ); // ISO-8859-1 high-bytes.
// E.g. The “ü” in ISO-8859-1 is a single byte 0xFC,
// but in UTF-8 is the two-byte sequence 0xC3 0xBC.
Differences:
just \xC0 testbecomesjust xC0 test✏is removed
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read the example in src/wp-includes/utf8.php and compare it with the rendered wp_is_valid_utf8() documentation. Trace how the PHP example is parsed, focusing on the missing \x and ✏ characters. Done means the documented example preserves both differences shown in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- documentation
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100