Skip to content

Commit c7b75d7

Browse files
committed
Fix PHP arrows in generated documentation.
Some example code in the generated docs contains the PHP arrow (`=>`), which is HTML-encoded and thus corrupted in code snippets. This fixes the generation for these instances.
1 parent ff35c6c commit c7b75d7

File tree

4 files changed

+13
-11
lines changed

4 files changed

+13
-11
lines changed

command.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,8 @@ function gen_cmd_pages( $cmd, $parent = array() ) {
513513
$docs = preg_replace( '/ > /', ' > ', $docs );
514514
$docs = preg_replace( '/ &lt;&lt;/', ' <<', $docs );
515515
$docs = preg_replace( '/&quot;/', '"', $docs );
516+
$docs = preg_replace( '/wp&gt; /', 'wp> ', $docs );
517+
$docs = preg_replace( '/=&gt;/', '=>', $docs );
516518

517519
// Strip global parameters -> added in footer
518520
$docs = preg_replace( '/#?## GLOBAL PARAMETERS.+/s', '', $docs );

commands/cli/param-dump/index.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,16 @@ options:
3131
# Dump the list of global parameters.
3232
$ wp cli param-dump --format=var_export
3333
array (
34-
'path' =&gt;
34+
'path' =>
3535
array (
36-
'runtime' =&gt; '=&lt;path&gt;',
37-
'file' =&gt; '&lt;path&gt;',
38-
'synopsis' =&gt; '',
39-
'default' =&gt; NULL,
40-
'multiple' =&gt; false,
41-
'desc' =&gt; 'Path to the WordPress files.',
36+
'runtime' => '=&lt;path&gt;',
37+
'file' => '&lt;path&gt;',
38+
'synopsis' => '',
39+
'default' => NULL,
40+
'multiple' => false,
41+
'desc' => 'Path to the WordPress files.',
4242
),
43-
'url' =&gt;
43+
'url' =>
4444
array (
4545

4646

commands/network/meta/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ display_global_parameters: true
1717
# Get a list of super-admins
1818
$ wp network meta get 1 site_admins
1919
array (
20-
0 =&gt; 'supervisor',
20+
0 => 'supervisor',
2121
)
2222

2323

commands/shell/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ that you can use within a WordPress plugin, for example.
2727

2828
# Call get_bloginfo() to get the name of the site.
2929
$ wp shell
30-
wp&gt; get_bloginfo( 'name' );
31-
=&gt; string(6) "WP-CLI"
30+
wp> get_bloginfo( 'name' );
31+
=> string(6) "WP-CLI"
3232

3333

3434

0 commit comments

Comments
 (0)