Small change: using jquerys .html() instead of .text() to enable usage of html entities #43

Open
wants to merge 1 commit into
from

Conversation

Projects
None yet
4 participants

haschek commented Sep 14, 2011

[mod] improving typography: enabling usage of non-breaking-space character ( ) in textfields, this is important to prevent a line break between the number and the timeframe

@haschek haschek [mod] improving typography: enabling usage of non-breaking-space char…
…acter ( ), this is important to prevent a line break between the number and the timeframe
d7d8845
Owner

rmm5t commented Sep 14, 2011

Thanks for taking the time to submit this, but I'm sorry, I'm not going to pull this in. Reasons:

  1. Not everyone will want the same non-breaking space behavior.
  2. All language packs would also have to be updated (not a clean design).
  3.   entities are kinda ugly.

It would be better to use CSS to manage whether you want the timestamps to wrap or not. For example, you can prevent word wrapping with something like this:

abbr.timeago { white-space: nowrap; }

or if you are willing to use a deprecated HTML tag, you can wrap the timestamp between <nobr></nobr>.

rmm5t closed this Sep 14, 2011

haschek commented Sep 14, 2011

Ok, thx for taking the time to check the pull request and answering. Let me explain it more detailed: using the   in the text settings would be optional, but if someone want to use it, .text() can't handle this, using .html() is necessary.

  1. Not everyone will want the same non-breaking space behavior.

Right, maybe. Even this is a typographical no-go :) Number and unit (timeframe) should not be splitted up on two lines.

  1. All language packs would also have to be updated (not a clean design).

No, that's not mandatory. Using the non-breaking-space char is only a option.

  1.   entities are kinda ugly.

Maybe, but's the HTML entity for the non-breaking-space character what is a typographical sign on its own.

It would be better to use CSS to manage whether you want the timestamps to wrap or not.

That would be possible but it's not the same. If you are using nowrap CSS, e.g. for "25 minutes ago" then the whole phrase cannot be splitted to two lines, what could lead to overflowed boxes or the whole line breaks before the 25. Same with the <nobr> usage. Using a non-breaking-space character "25 minutes" is kept together but "ago" can be on the next line. A slight but typographically important difference :)

regards,
Haschek

Owner

rmm5t commented Sep 14, 2011

Haschek, Okay, you've made a strong enough argument for me to reopen this. Let me give it some thought to make sure there wasn't a good reason for me using text() instead of html().

rmm5t reopened this Sep 14, 2011

chustar commented Jul 7, 2012

@rmm5t Any updates on this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment