& at the end of a line is not getting wrapped.

jbjaaz - October 11, 2007 - 23:22
Project:Typogrify
Version:5.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

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" –&nbsp;&amp;

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.

#1

Tim Gambell - November 17, 2007 - 23:00

Hi jbjaaz,

I suspect the &amp; isn't getting wrapped because the final space of the string is being replaced with a non breaking space before the &amp;s get wrapped. That makes the &amp; 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 &nbsp;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.

#2

Tim Gambell - November 17, 2007 - 23:51
Assigned to:Anonymous» Tim Gambell

#3

mikl - January 13, 2009 - 13:10
Title:multiple refinements are not processed» & at the end of a line is not getting wrapped.
Assigned to:Tim Gambell» mikl

The 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.

#4

mikl - April 28, 2009 - 18:28
Assigned to:mikl» Anonymous
Status:active» postponed

Given 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.

#5

mikl - October 20, 2009 - 09:25
Status:postponed» closed

This is really getting old, closing. Reopen if you are willing to do the work :).

 
 

Drupal is a registered trademark of Dries Buytaert.