Make WordPress Core

Opened 13 years ago

Closed 12 years ago

#27588 closed defect (bug) (fixed)

Shortcodes and nbsp

Reported by: miqrogroove Owned by: DrewAPicture
Priority: normal Milestone: 4.0
Component: Formatting Version: 3.8
Severity: normal Keywords: has-patch 4.0-early
Cc: Focuses: docs

Description

Continuing from #22692 and as a requirement for #26842, we need to make sure things like  [gallery ids="37,15,11"]  are treated the same as if they are surrounded by whitespace.

The patch for shortcode_unautop() is ready, and there could be other changes needed.

Attachments (3)

prior-work.patch​ (3.3 KB ) - added by miqrogroove 13 years ago.
miqro-27588.patch​ (2.7 KB ) - added by miqrogroove 12 years ago.
Refreshed
miqro-27588.2.patch​ (3.3 KB ) - added by miqrogroove 12 years ago.
Filter docs added.

Download all attachments as: .zip

Change History (15)

#1 @miqrogroove
13 years ago

  • Keywords has-patch 4.0-early added

#2 follow-up: @wonderboymusic
12 years ago

In 28708:

Add a function: wp_spaces_regexp(). It is not used yet.

This function is required by a bunch of patches by miqrogroove. Needs filter docs.

Props miqrogroove.
See #27588.

#3 @wonderboymusic
12 years ago

  • Focuses docs added
  • Keywords needs-docs added

#4 follow-up: @SergeyBiryukov
12 years ago

What would be a use case for the wp_spaces_regexp filter?

#5 @wonderboymusic
12 years ago

Good question - if there isn't a good one, we can delete it.

#6 follow-up: @DrewAPicture
12 years ago

  • Milestone Awaiting Review → 4.0

Seems like the use case would be to change the regex, unless I'm missing something, currently it includes "spaces include new lines, tabs, nbsp entities, and the UTF-8 nbsp".

Happy to write the hook docs if ya'll come to a consensus on whether to keep the filter.

#7 in reply to: ↑ 6 @SergeyBiryukov
12 years ago

Replying to DrewAPicture:

Seems like the use case would be to change the regex, unless I'm missing something, currently it includes "spaces include new lines, tabs, nbsp entities, and the UTF-8 nbsp".

Yeah, I mean, is there a need for this regex to be filterable?

#8 in reply to: ↑ 4 @miqrogroove
12 years ago

Replying to SergeyBiryukov:

What would be a use case for the wp_spaces_regexp filter?

Primarily for anyone not using UTF-8. NBSP has alternative encodings.

@miqrogroove
12 years ago

Refreshed

@miqrogroove
12 years ago

Filter docs added.

#9 in reply to: ↑ 2 @miqrogroove
12 years ago

  • Keywords needs-docs removed

Replying to wonderboymusic:

In 28708:

Add a function: wp_spaces_regexp(). It is not used yet.

This function is required by a bunch of patches by miqrogroove. Needs filter docs.

Props miqrogroove.
See #27588.

Thank you. Patch refreshed.

#10 @wonderboymusic
12 years ago

In 28716:

Ensure that shortcode_unautop() treats   like whitespace.
shortcode_unautop() and wptexturize() now use wp_spaces_regexp() instead of raw regex.

Adds unit tests.

Props miqrogroove.
See #27588.

#11 @wonderboymusic
12 years ago

  • Owner set to DrewAPicture
  • Status new → assigned

Please review/alter/whatever the inline docs. If they're good, mark as fixed. Otherwise, commit whatever then mark as fixes.

#12 @DrewAPicture
12 years ago

  • Resolution → fixed
  • Status assigned → closed

In 28724:

Improve inline documentation for the wp_spaces_regexp filter.

Fixes #27588.

Note: See TracTickets for help on using tickets.