WordPress.org

Make WordPress Core

Opened 2 years ago

Last modified 2 years ago

#23083 new enhancement

Tag balancing for text widgets

Reported by: mark-k Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Widgets Keywords: has-patch needs-testing
Focuses: Cc:

Description

Based on inspecting the code it looks like tag balancing is not applied to th content of the text widget.

IMO people are more likely to produce broken HTML when adding HTML in a text widget then when writing post, but tag balancing is done only for posts and comments (in which HTML is rarely used).

Attachments (2)

23083.diff (469 bytes) - added by MikeHansenMe 2 years ago.
adds tag balancing to text widget
23083.2.diff (462 bytes) - added by MikeHansenMe 2 years ago.
uses balanceTags instead of force_balance_tags to make use optional

Download all attachments as: .zip

Change History (7)

comment:1 @rachelbaker2 years ago

  • Cc rachelbaker added

@MikeHansenMe2 years ago

adds tag balancing to text widget

comment:2 follow-up: @MikeHansenMe2 years ago

  • Cc mdhansen@… added

The patch only changes the way the code is displayed on the front. It does not alter the html input. There may need to be a similar js implementation.

comment:3 in reply to: ↑ 2 @mark-k2 years ago

@MikeHansenMe, isn't it better to hook balanceTags to get the use_balanceTags option into play in case there are people that don't want balancing?

@MikeHansenMe2 years ago

uses balanceTags instead of force_balance_tags to make use optional

comment:4 @MikeHansenMe2 years ago

@mark-k I was thinking mostly of people copying code snippets without knowledge of the code. Perhaps we would be doing them a favor but in the end I think you are right. It should be optional.

comment:5 @MikeHansenMe2 years ago

  • Keywords has-patch needs-testing added
Note: See TracTickets for help on using tickets.