WordPress GSoC

Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#302 closed task (fixed)

Prettify indention in revisions view

Reported by: ahoereth's profile a.hoereth Owned by: ahoereth's profile a.hoereth
Milestone: 2013 Final (1.0) Priority: normal
Component: Code Revisions Keywords:
Cc:

Description

wp-admin/revision.php at the moment does not display indentations which are important when viewing code revisions. See attached images for examples.

Core most likely will bring back a maximum of one possible leading space per line. Having revisions.php display actual tabs or multiple spaces at line beginnings and multiple spaces in between words for better multi-line alignment would be nice.

To fix this revision.php requires table.diff { white-space: pre-wrap; } (will get into core according to ocean90) and wp_text_diff needs changes to not remove /[ \t]+/ in line 1708 and 1709. An alternative to normalize_whitespace might be required here. Changing the original function in core is not appropriate because it's expected to work the way it does.

Attachments (2)

is.PNG (3.7 KB) - added by a.hoereth 12 years ago.
should_be.PNG (4.0 KB) - added by a.hoereth 12 years ago.

Download all attachments as: .zip

Change History (11)

@a.hoereth
12 years ago

@a.hoereth
12 years ago

#1 @a.hoereth
12 years ago

.pre will be added to table.diff: #24425.

In addition removing normalize_whitespace from wp_text_diff (is pluggable) does the trick. This change will be restricted to posts of the code custom post type (post_id is passed on revision ajax requests) and should therefore not bring any unexpected changes to WP default behavior.

Last edited 12 years ago by a.hoereth (previous) (diff)

#2 @a.hoereth
12 years ago

CSS changes in [2047]

#3 @a.hoereth
12 years ago

In 2104:

Core has white-space: pre-wrap now. See #302

#4 @a.hoereth
12 years ago

In 2107:

Missed updating checksum on restore (see #303) and remove additional line padding in revision viewer (see #302)

#5 @a.hoereth
12 years ago

In 2109:

Redo correct part of [2107]:
Missed updating checksum on restore (see #303) and remove additional line padding in revision viewer (see #302)

#6 @a.hoereth
12 years ago

In 2115:

Only change padding when viewing revisions associated with posts of our custom post type. See #302

#7 @a.hoereth
12 years ago

In 2222:

Plugging wp_text_diff() function for preserving line breaks and multi-spacing in the revisions viewer when viewing code revisions. See #302

#8 @a.hoereth
12 years ago

  • Owner set to a.hoereth
  • Status changed from new to accepted

#9 @a.hoereth
12 years ago

  • Resolution set to fixed
  • Status changed from accepted to closed
Last edited 12 years ago by a.hoereth (previous) (diff)
Note: See TracTickets for help on using tickets.