halostatue/text-hyphen — pull request #4 by e2 (2012-04-29 21:47:16+00:00)
Title: Allow specifying hyphen character.

Hi!

Patch (with tests) that allows user to specify something other than '-' (hyphen-minus) for hyphen.

Tested on Ruby 1.9.3 and 1.8.7.

I was wondering if this belongs here. I believe it does, since prawnpdf/prawn expects the soft-hyphen "\u00AD" instead.

Sure, users could just use:

.gsub('-', "\u00AD")

but that would need to be done on every word, even when the result is already cached by text-hyphen.

Also, people often use the minus sign because it's on the keyboard, when they really mean one of:

- hyphen bullet ("\u2043") [yes, I just "sinned" too, but markdown forgives me ...]

- non-breaking hyphen ("\u2011")

- unicode minus sign ("\2212")

- a ... um ... hyphen ("\2010")

Sorry for the rant, I just wanted to show I did my homework and some thinking.