WordPress.org

Make WordPress Core

Opened 12 years ago

Closed 4 years ago

Last modified 7 months ago

#5161 closed enhancement (fixed)

balance_tags option should not be in the user interface

Reported by: JeremyVisser Owned by: pento
Milestone: 4.3 Priority: normal
Severity: normal Version: 2.3
Component: Formatting Keywords: has-patch
Focuses: administration Cc:
PR Number:

Description

In the WP Admin → Options → Writing (options-writing.php), there is an option "WordPress should correct invalidly nested XHTML automatically" which controls whether balance_tags() is run on post content or not.

I'm fully supportive of this feature — I think it's important to ensure the HTML that is output to browsers is valid. There have been a few situations where users needed to turn this off, e.g. bugs in the function, or a plugin misbehaves with it on (if I remember correctly, runPHP).

However, this is a KDE-style option where it is put there for a niche case. In 99% of cases, you will want it on.

A few people on the mailing lists have stated a number of times that we should take a GNOME-like approach to these sort of features, and let them be controlled only by plugins. This option is left over from the dark ages of WordPress, and I don't think the cases for turning it off are big enough to warrant its inclusion in the user interface.

If a plugin has a problem with balancing tags (e.g. runPHP), the offending plugin can simply remove the filter.

remove_filter('content_save_pre', 'balance_tags);

(...or whatever the code would be.)

The new canonical redirect feature has far more many problems, and far more justification for it to be turned off, yet I don't see a checkbox "Redirect links to their canonical URL" anywhere in the user interface. If anything should have a checkbox, it's the canonical redirect feature — but, it doesn't have any such thing. So, we should remove this checkbox as well.

Attachments (1)

5161.diff (1.8 KB) - added by pento 4 years ago.

Download all attachments as: .zip

Change History (21)

#1 @Otto42
12 years ago

I cannot even begin to count the number of times that people complain on the support forums about WordPress messing up their oh-so-perfect HTML that they manually put into the thing.

-1 to this idea. If anything, the option should be expanded in scope to disable all of WordPress's auto-correction features, such as autop and everything else. If somebody wants their text to go unmolested, then that option should be available.

#2 @JeremyVisser
12 years ago

I'm open to that suggestion as well, and considered that as well, but my thoughts started getting too convoluted at around the 4th paragraph of the description, so I declined to include it. ;)

#3 @caesarsgrunt
11 years ago

  • Type changed from defect to enhancement

+1. Actually, I'd like some form of per-post setting, but I think as a generic one it's nearly useless.

Like most people I keep this feature turned on - just as I usually use the visual editor. But it would be nice to be able to disable it on a per-post basis just as easily as one can leave the visual editor and edit the HTML directly.

In fact I should think most people who just switch to the HTML view for a
individual posts don't want the balance_tags filter or any other auto-correction to 'mess up' the HTML they specifically wanted to enter themselves.

But I may be wrong! :)

#4 @FFEMTcJ
11 years ago

  • Keywords dev-feedback needs-patch added
  • Milestone changed from 2.9 to Future Release

#5 @Denis-de-Bernardy
10 years ago

  • Component changed from Administration to UI
  • Keywords dev-feedback removed
  • Milestone changed from Future Release to 2.9
  • Owner anonymous deleted
  • Severity changed from minor to normal

#6 @Denis-de-Bernardy
10 years ago

  • Keywords 2nd-opinion removed

I'd second removing the option from the interface and enforcing this automatically. but only after all of the wp formatting bugs are hunted down and fixed.

#7 @Denis-de-Bernardy
10 years ago

  • Milestone changed from 2.9 to Future Release

#8 follow-up: @solarissmoke
9 years ago

  • Keywords dev-feedback added

4 years later... does anyone still want to see this happen?

#9 in reply to: ↑ 8 @strider72
8 years ago

Replying to solarissmoke:

4 years later... does anyone still want to see this happen?

As WordPress development shows such a Jobsianly strong interest (per Matt) in keeping the Core UI simple and letting plugins handle the fringe cases, I'm all for this so long as it can be re-implemented with a plugin for those cases where it's needed.

The only concern I have is the transition. When this hits Core we would definitely have to have that plugin available and let people know about it. (Of course removing the checkbox doesn't have to change existing settings....)

#10 @DrewAPicture
7 years ago

  • Component changed from UI to Administration

#11 @helen
7 years ago

  • Component changed from Administration to Formatting

This ticket was mentioned in Slack in #meta by chriscct7. View the logs.


4 years ago

#13 @chriscct7
4 years ago

  • Component changed from Formatting to Administration
  • Focuses administration added

I propose removing this option and the :-) to smily option (#32298) so we can remove that whole section. If someone really wants to do this, there is a filter for this, and by default, not many people use this particular option as pointed out. Most people who just switch to the HTML view for a
individual posts don't want the balance_tags filter or any other auto-correction to 'mess up' the HTML they specifically wanted to enter themselves.

This ticket was mentioned in Slack in #core by chriscct7. View the logs.


4 years ago

#15 @chriscct7
4 years ago

  • Component changed from Administration to Formatting

@pento
4 years ago

#16 @pento
4 years ago

  • Keywords has-patch added; needs-patch dev-feedback removed
  • Milestone changed from Future Release to 4.3

I'm in favour of enabling this by default and removing the option.

In 5161.diff:

  • Default the use_balanceTags option to enabled.
  • Hide the Balance Tags and Smilies options for new installs (because it's easier to do this and #32298 as one patch).

Smilies will definitely be happening, but I'm open to feedback on balance tags before I commit this.

#17 @pento
4 years ago

On second thoughts, I'm not wild about enabling balance tags by default. It's mostly handled by the editor these days, so isn't really necessary. Also, code that currently isn't enable by default isn't as well tested, so it's more likely to have bugs. I'm happy with just removing the option from the UI, and letting people use a filter if they really want it.

#18 @pento
4 years ago

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

In 32454:

On the Writing Options screen, hide the Balance Tags and Convert Smilies options on new installs.

Fixes #5161.
Fixes #32298.

#19 @pento
4 years ago

In 32455:

When saving Writing Options, check that the UI is enabled for use_smilies and use_balanceTags before trying to update them.

Fixes #5161.
Fixes #32298.

This ticket was mentioned in Slack in #forums by ipstenu. View the logs.


7 months ago

Note: See TracTickets for help on using tickets.