Run Ragged

14 Comments

Comments are ordered by helpfulness, as indicated by you. Help us pick out the gems and discourage asshattery by voting on notable comments.

Got something to add? You can leave a comment below.

  1. Jon Tan

    Great stuff, Mark, and thanks for the mention! I’d like to suggest that the numeric entity for a non break space ( ) is used if the markup needs to be parsed into XML/RSS/ATOM because nbsp doesn’t exist in XML as far as I remember.

  2. Ben Barber

    I’m glad you mentioned hyphens, though they probably need an entire post to cover them adequately. I experimented with @hyphens:auto@, but it hyphenated too aggressively and made the content challenging to read.

    If I was to do it again, I think I’d set @hyphens:manual@ and then take an approach similar to Ragadjust — add @­@ to select words as necessary.

  3. Anatol Broder

    I use similar rules for writing prose in Russian and German for years. In these languages words can be very long. An important addition is the usage of handcrafted @­@. Please don’t use the CSS automation for hyphenation. It’s not reliable.

    For those who write in Markdown, I recommend to use the middle dot (·) for setting @ @ and the tilde (~) or the obulus (÷) for @­@. The replacement should happen in the post-markdown process. Redcarpet may be the first Markdown renderer with native support for this feature.

    Mark, I’m curious, why don’t you use the rules in your own website?

    This comment contains non-break spaces.

  4. Adam Havel

    An excellent article. But I agree with Josiah, this kind of processing probably shouldn’t be done during a document load. I’ve tried to make a grunt task based on the script by Nathan Ford and even though it’s not that universal, it is I believe a little more robust and much more configurable. Try it and tell me what you think.

  5. Adam Havel

    As Josiah noted I would rather do this server-side. I created a grunt task just for that, based on the Nathan Ford’s plugin. It’s a little bit more robust and configurable than the original solution, but obviously a lot less universal.

  6. Josiah Sprague

    Very interesting and simple solution. I do think there is a lot of value in getting typography right, but I wonder if having the browser handle it via JavaScript has marginal gains for typography, at the price of some speed, usability or other front-end concerns. Why not have a script that handles this within the CMS or on the server, since it only needs to happen once, and not every time the page is rendered.

  7. Martin Pitt

    Speaking as a dyslexic, I strongly disagree with the prepositions rule.

    Whenever I am forced to break a line I always try to break after prepositions whenever possible as it is then easier to flow line-to-line. This is especially noticeable in large paragraphs.

    Otherwise I often and almost always find myself backing up and trying to re-read the previous line to understand how a sentence relates to the next line due to not having been primed to do so. With a preposition I can mentally anticipate the connection and therefore read it fluently.

  8. Ray Murray

    I tried Ragadjust on my site and blog. On the site, all was fine, while on the blog (a Blogger issue perhaps), all of those prepositions were deleted from my entries! I had to resort to a forked version which has the preposition facility removed. Otherwise a very good tool.

Impress us

Be friendly / use Textile