Make WordPress Core

Opened 19 years ago

Closed 16 years ago

Last modified 11 years ago

#3810 closed defect (bug) (duplicate)

Wrong quotation mark after bracket

Reported by: josepo's profile josepo Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.1.1
Component: Formatting Keywords:
Focuses: Cc:

Description

formatting.php sets a closing quotation mark after a bracket, even at the beginning of words. Example:

A dog ("Hubertus") was sent out.

The first quotation mark will not be formatted properly. This looks especially ugly when using the intypo plugin.

Solution: In formatting.php, replace the line

$dynamic_characters = array('/\'(\d\d(?:’|\')?s)/', '/(\s|\A|")\'/', '/(\d+)"/', '/(\d+)\'/', '/(\S)\'([\'\s])/', '/(\s|\A)"(?!\s)/', '/"(\s|\S|\Z)/', '/\'([\s.]|\Z)/', '/(\d+)x(\d+)/');

with

$dynamic_characters = array('/\'(\d\d(?:’|\')?s)/', '/(\s|\A|")\'/', '/(\d+)"/', '/(\d+)\'/', '/(\S)\'([\'\s])/', '/(\s|\A|\s\(|\A\()"(?!\s)/', '/"(\s|\S|\Z)/', '/\'([\s.]|\Z)/', '/(\d+)x(\d+)/');

Attachments (2)

3810.diff (1.1 KB) - added by Nazgul 19 years ago.
formatting.diff (1.0 KB) - added by mrmist 17 years ago.
refreshed against 10257

Download all attachments as: .zip

Change History (21)

#1 @josepo
19 years ago

This solution is a whole lot better yet (covers all expressions where the delimiting blank does not immediately precede or follow the quotation mark):

$dynamic_characters = array('/\'(\d\d(?:’|\')?s)/', '/(\s|\A|")\'/', '/(\d+)"/', '/(\d+)\'/', '/(\S)\'([\'\s])/', '/(\s|\A|\s\S|\A\S)"(?!(\s|\A|\S\s|\S\A))/', '/"(\s|\S|\Z)/', '/\'([\s.]|\Z)/', '/(\d+)x(\d+)/');

Currently,

<p>A dog named "<a href="http://...">Hubertus</a>":</p>

results in the second quotation mark turning the wrong way. This is fixed by the solution shown above. (Of course, it also covers the bracket problem.)

#2 @foolswisdom
19 years ago

  • Milestone changed from 2.1.2 to 2.2
  • Version set to 2.1.1

@Nazgul
19 years ago

#3 @Nazgul
19 years ago

  • Keywords has-patch added

Patch based on given code snippet added.

#4 @markjaquith
19 years ago

  • Keywords 2nd-opinion needs-testing added

#5 @foolswisdom
19 years ago

  • Milestone changed from 2.2 to 2.3

#6 @Nazgul
18 years ago

  • Milestone changed from 2.3 to 2.4

#7 @thee17
18 years ago

  • Milestone changed from 2.5 to 2.6

@mrmist
17 years ago

refreshed against 10257

#8 @mrmist
17 years ago

  • Milestone changed from 2.9 to 2.8

I've refreshed the patch on this. Shifting to 2.8 since it has a patch and has been languishing.

It'd suggest it either goes in or is closed.

#9 @mrmist
17 years ago

See also #4539

#10 @ryan
17 years ago

  • Component changed from General to Formatting
  • Owner anonymous deleted

#11 @Denis-de-Bernardy
17 years ago

  • Milestone changed from 2.8 to 2.9

Maybe wontfix, yeah. it's been open and ignored for so long... :D

Maybe someone who shows up with a full load of tests with results might convince devs to commit, though.

#12 @Denis-de-Bernardy
17 years ago

  • Keywords 2nd-opinion removed
  • Milestone changed from 2.9 to 2.8

#13 @azaozz
17 years ago

  • Milestone changed from 2.8 to Future Release

Partial duplicate of #8775, perhaps better to merge them.

#14 @Denis-de-Bernardy
17 years ago

  • Keywords needs-unit-tests added

Let's worry about merging all of the formatting tickets after 2.8. They've been open for so long that it doesn't matter much if it gets fixed now or then.

Punting pending unit-tests.

#15 @Denis-de-Bernardy
16 years ago

  • Milestone changed from Future Release to 2.9

#16 @hakre
16 years ago

+1 for merging

#17 @westi
16 years ago

  • Resolution set to duplicate
  • Status changed from new to closed

Dupe of #1418.

I have added this explicit test case to wordpress-tests.

Fixed in [11813]

#18 @hakre
16 years ago

  • Keywords has-patch needs-testing needs-unit-tests removed

#19 @DrewAPicture
11 years ago

  • Milestone 2.9 deleted
Note: See TracTickets for help on using tickets.