@@ -437,5 +437,89 @@ Feature: Scaffold a README.md file for an existing package
437437
438438 When I run `wp --require=foo/command.php scaffold package-readme foo`
439439 Then the foo/README.md file should exist
440- And the contents of the foo/README.md file should match /\t\t.*Read content from/
441- And the contents of the foo/README.md file should match /\t\t.*Passing/
440+ And the contents of the foo/README.md file should match /\t\tRead content from/
441+ And the contents of the foo/README.md file should match /\t\tPassing/
442+
443+ Scenario : README correctly indents continuation paragraphs with zero leading spaces
444+ Given an empty directory
445+ And a foo/command.php file:
446+ """
447+ <?php
448+ /**
449+ * Zero-space continuation test command.
450+ */
451+ class Zero_Space_Test_Command {
452+ /**
453+ * Test command where continuation paragraph has no leading spaces.
454+ *
455+ * ## OPTIONS
456+ *
457+ * [--extra]
458+ * : Show extended version information.
459+ *
460+ * Note: to retrieve the database revision for an individual subsite,
461+ * use `wp option get db_version --url=<subsite>`.
462+ *
463+ * @when before_wp_load
464+ */
465+ public function __invoke( $args, $assoc_args ) {}
466+ }
467+ WP_CLI::add_command( 'zero-space-test', 'Zero_Space_Test_Command' );
468+ """
469+ And a foo/composer.json file:
470+ """
471+ {
472+ "name": "wp-cli/zero-space-test",
473+ "description": "Test",
474+ "extra": {
475+ "commands": ["zero-space-test"]
476+ }
477+ }
478+ """
479+
480+ When I run `wp --require=foo/command.php scaffold package-readme foo`
481+ Then the foo/README.md file should exist
482+ And the contents of the foo/README.md file should match /\t\tShow extended version information/
483+ And the contents of the foo/README.md file should match /\t\tNote: to retrieve/
484+
485+ Scenario : README correctly indents continuation paragraphs with one leading space
486+ Given an empty directory
487+ And a foo/command.php file:
488+ """
489+ <?php
490+ /**
491+ * One-space continuation test command.
492+ */
493+ class One_Space_Test_Command {
494+ /**
495+ * Test command where continuation paragraph has one leading space.
496+ *
497+ * ## OPTIONS
498+ *
499+ * [--extra]
500+ * : Show extended version information.
501+ *
502+ * Note: to retrieve the database revision for an individual subsite,
503+ * use `wp option get db_version --url=<subsite>`.
504+ *
505+ * @when before_wp_load
506+ */
507+ public function __invoke( $args, $assoc_args ) {}
508+ }
509+ WP_CLI::add_command( 'one-space-test', 'One_Space_Test_Command' );
510+ """
511+ And a foo/composer.json file:
512+ """
513+ {
514+ "name": "wp-cli/one-space-test",
515+ "description": "Test",
516+ "extra": {
517+ "commands": ["one-space-test"]
518+ }
519+ }
520+ """
521+
522+ When I run `wp --require=foo/command.php scaffold package-readme foo`
523+ Then the foo/README.md file should exist
524+ And the contents of the foo/README.md file should match /\t\tShow extended version information/
525+ And the contents of the foo/README.md file should match /\t\tNote: to retrieve/
0 commit comments