Closed (fixed)
Project:
Typogrify
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
11 Oct 2007 at 23:22 UTC
Updated:
20 Oct 2009 at 09:25 UTC
So, I've been banging my head with this.
I want to make sure titles are typogrified, so I'm doing the following in my template.php
$vars['title'] = module_invoke('typogrify', 'filter', 'process', null, 3, $vars['title']);
The string I'm parsing is...
NEA Chairman to Address the "Freedom to Create" -- &
The result is...
<span class="caps">NEA</span> Chairman to Address the "Freedom to Create" – &
It does the span class="caps" and it appears the ndash, but then it skips over the quotes and the ampersand.
Any ideas?
Note, all settings are turned on.
Comments
Comment #1
Tim Gambell commentedHi jbjaaz,
I suspect the
&isn't getting wrapped because the final space of the string is being replaced with a non breaking space before the&s get wrapped. That makes the&invisible when typogrify tries to go and fix it. This happens because typogrify assumes that an ampersand will never be the last word of a paragraph.That said, I can't think of a good reason not to change the order that the
s are added. That should fix your problem. I'll work on it.As for the quotation marks, it sounds like you're encountering the bug described here. Is that correct? I'll be looking into that bug, shortly, but if your bug is unrelated, let me know.
Comment #2
Tim Gambell commentedComment #3
miklThe quotes-thing from #180394: Better admin UI for SmartyPants settings. is no longer a problem, I'm renaming this.
The consequences of reordering the filters will have to be tested heavily before we can do it, so I think I'll start out by making some simpletests for this module.
Comment #4
miklGiven how old this is and how few requests there have been to have it fixed, I would like to know if this is a real-world problem.
I find it hard to come up with a real-world use case where this might be a problem, so until someone can convince me otherwise, I'm going to adopt a "patches accepted" stance on this issue.
Comment #5
miklThis is really getting old, closing. Reopen if you are willing to do the work :).