WordPress.org

Making WordPress.org

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#1461 closed defect (invalid)

Code Reference parser treats indents in docblocks as blockquotes

Reported by: morganestes Owned by:
Milestone: Priority: normal
Component: Developer Hub Keywords: has-screenshots needs-patch close
Cc:

Description

When a function docblock has indented lines in the parameter descriptions, the parser treats those as blockquote indentations, throwing off the view of the Developer Resources page.

Example: https://developer.wordpress.org/reference/functions/get_post_type_labels/ pulls from https://core.trac.wordpress.org/browser/tags/4.4/src/wp-includes/post.php#L1310, which makes some of the parameters break on when viewing the docs.

https://cldup.com/LVrPgVAS0v.png

Change History (4)

This ticket was mentioned in Slack in #docs by morganestes. View the logs.


4 years ago

#2 @DrewAPicture
4 years ago

  • Keywords close added
  • Resolution set to invalid
  • Status changed from new to closed

In this particular case, I think the line is being incorrectly wrapped and indented. And in fact, I removed the indentation in [wp35868]. The fact that parsedown is correctly turning this formatted content into an unordered list is something I would consider "getting for free". As such, suggest wontfix.

#3 follow-up: @morganestes
4 years ago

I understand the reason for the indentation inside the docblock;
Sure, the "free" unordered list is great, but there are some other issues with the formatting here. Not sure if each one needs a separate ticket, but here's a few just on this page:

  • Ignoring the inline @link inside 'add_new' description
  • Comment straight quotes converted to "smart" quotes
  • Missing parameter names and descriptions: 'filter_items_list', 'items_list_navigation', 'items_list'

#4 in reply to: ↑ 3 @DrewAPicture
4 years ago

Replying to morganestes:

I understand the reason for the indentation inside the docblock;
Sure, the "free" unordered list is great, but there are some other issues with the formatting here. Not sure if each one needs a separate ticket, but here's a few just on this page:

  • Ignoring the inline @link inside 'add_new' description
  • Comment straight quotes converted to "smart" quotes
  • Missing parameter names and descriptions: 'filter_items_list', 'items_list_navigation', 'items_list'

All valid points and issues, but not related to indentation :-)

Feel free to create separate tickets.

Note: See TracTickets for help on using tickets.