Making WordPress.org

Opened 3 years ago

Last modified 2 years ago

#5855 reopened defect (bug)

Correct formatting for code blocks imported from GitHub PRs, take 2

Reported by: sergeybiryukov's profile SergeyBiryukov Owned by:
Milestone: Priority: normal
Component: Trac Keywords:
Cc:

Description

Background: #4903, #5308.

As seen in some comments on #WP22316, the formatting of code blocks still looks broken:

https://core.trac.wordpress.org/ticket/22316#comment:93

`json
{

"name": "vendor/my-plugin",
"description: "....",
/* snip */
"wordpress": {

...

}

}

https://core.trac.wordpress.org/ticket/22316#comment:94

{{{json
{

"plugin-dependencies": [

{

"slug": "gutenberg",
"name": "Gutenberg"

},
{

"slug": "woocommerce",
"name": "WooCommerce"

}

]

}
}}}

It looks like converting the GitHub syntax for code blocks to the syntax that Trac recognizes could use some adjustment.

Change History (5)

#1 @SergeyBiryukov
3 years ago

  • Component changed from General to Trac

#2 @dd32
3 years ago

In 11244:

Trac: GitHub: When importing GitHub code blocks, support/import the code format specifier.

This might not solve all of the differences, but should at least import it as a code block rather than as a broken block.

See #5855.

#3 @dd32
3 years ago

In 11245:

Trac: GitHub: When importing code blocks from GitHub, import the code blocks properly. Take two.

See #5855.

#4 @dd32
3 years ago

  • Resolution set to fixed
  • Status changed from new to closed

Marking as fixed, as I believe this is fixed.

Re-open if there's still examples of the code blocks importing badly.

#5 @SergeyBiryukov
2 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Another example: https://core.trac.wordpress.org/ticket/36907#comment:15

{{{php
/

  • Ensure all sticky posts are included, no matter how many. *
  • @ticket 36907 */

public function test_query_should_return_all_stickies() {

$old_option = get_option( 'sticky_posts' );
foreach ( self::$posts as $post_id ) {

stick_post( $post_id );

}

$q = new WP_Query( array( 'post_type' => 'post' ) );
22 sticky posts, 1 hello world.
$this->assertCount( 23, $q->posts );

update_option( 'sticky_posts', $old_option );

}
}}}

Note: See TracTickets for help on using tickets.