WordPress.org

Making WordPress.org

Opened 5 weeks ago

Closed 4 weeks ago

#5308 closed defect (fixed)

Correct formatting for code blocks imported from GitHub PRs

Reported by: SergeyBiryukov Owned by: dd32
Milestone: Priority: normal
Component: Trac Keywords:
Cc:

Description

Background: #4903

As seen in https://core.trac.wordpress.org/ticket/43941#comment:71, the formatting of code blocks looks broken:

Take the following example
`

register_meta('post', 'my_meta', [

'object_subtype' => 'post',
'single' => false,
'show_in_rest' => [

...

],
'type' => 'array',
'default' => array(233),

]);

`

The GitHub syntax:

```
```

should be converted to the syntax that Trac recognizes:

{{{
}}}

Change History (4)

#1 @dd32
5 weeks ago

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

In 10031:

Trac: PRs: Convert code blocks from GH to Trac syntax.

Fixes #5308.

#2 follow-up: @SergeyBiryukov
4 weeks ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Looks like [10031] didn't work as expected for some reason:
https://core.trac.wordpress.org/ticket/50669#comment:5
https://github.com/WordPress/wordpress-develop/pull/407#issuecomment-658788769

Could we also convert links from the GitHub syntax:

([`add_editor_style()`](https://github.com/WordPress/wordpress-develop/blob/b00172339467889b736cf0a8d0a7bc5a502b1158/src/wp-includes/theme.php#L2037)

to Trac syntax?

[https://github.com/WordPress/wordpress-develop/blob/b00172339467889b736cf0a8d0a7bc5a502b1158/src/wp-includes/theme.php#L2037 `add_editor_style()`]

#3 in reply to: ↑ 2 @dd32
4 weeks ago

Replying to SergeyBiryukov:

Looks like [10031] didn't work as expected for some reason:

I suspect there might be two different codepaths in play, and one isn't calling the syntax translate function.

Could we also convert links from the GitHub syntax:

I saw a bunch of these this morning and was going to add that today, I think images are another one.

#4 @dd32
4 weeks ago

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

In 10072:

Trac: PRs: Transform Github comments to Trac syntax in addition to the PR description.
This also converts links and images to Trac syntax.

Fixes #5308.

Note: See TracTickets for help on using tickets.