Skip to content

Commit 9b41ff9

Browse files
committed
Stop normalizing documentation text in the diff tool
Match the exporter: documentation text is exported as authored, so the diff tool has nothing to reconcile in descriptions, tag content, or the `refers`/`link` tokens — and normalizing them would hide a real change in exactly the fields the exporter promises not to touch. Expression and type fields keep the anchored-prefix normalization the exporter still applies.
1 parent 6ce9808 commit 9b41ff9

1 file changed

Lines changed: 1 addition & 15 deletions

File tree

‎prep-diff.php‎

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -99,24 +99,10 @@ function wp_parser_prep_diff_normalize_scalar( $value, array $path, $key ) {
9999
return $value;
100100
}
101101

102-
if ( in_array( $key, array( 'content', 'description', 'long_description' ), true ) ) {
103-
return preg_replace_callback(
104-
'~{@(?:link|see)\s+([^}\s]+)~',
105-
static function( $matches ) {
106-
return str_replace(
107-
$matches[1],
108-
\WP_Parser\strip_global_namespace_prefix( $matches[1] ),
109-
$matches[0]
110-
);
111-
},
112-
$value
113-
);
114-
}
115-
116102
$parent_key = 1 < count( $path ) ? $path[ count( $path ) - 2 ] : null;
117103
$normalize = in_array(
118104
$key,
119-
array( 'class', 'default', 'extends', 'link', 'refers', 'type', 'value' ),
105+
array( 'class', 'default', 'extends', 'type', 'value' ),
120106
true
121107
);
122108

0 commit comments

Comments
 (0)