# Title prettify should be respecting word breaks (1/4/2011)

**URL:** <https://meta.discourse.org/t/title-prettify-should-be-respecting-word-breaks-1-4-2011/31227>\
**Category:** Bug\
**Created:** [7월 20, 2015, 11:56오후 UTC](https://meta.discourse.org/t/title-prettify-should-be-respecting-word-breaks-1-4-2011/31227 "2015-07-20T23:56:00Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)\
**Post date:** [7월 20, 2015, 11:56오후 UTC](https://meta.discourse.org/t/title-prettify-should-be-respecting-word-breaks-1-4-2011/31227/1 "2015-07-20T23:56:00Z")

</div>

`New Release - Firmware Version 1.02.06 for My Book World Edition I & II (1/4/2011)`

Is rendered as:

![](https://global.discourse-cdn.com/meta/optimized/3X/6/e/6eaa51ec558b40c1bc7d0172e6aa53578b6ed430_2_690x96.png)

The 🌜 magic shanaigens should only happen if there is a space between it and other words… EG:

`Sam and a 1/4` should get quarter magic  
`Sam was born 1/4/2001` should get **no** quarter magic.

---

<div class="post-metadata">

**Author:** ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)\
**Post date:** [7월 21, 2015, 1:40오전 UTC](https://meta.discourse.org/t/title-prettify-should-be-respecting-word-breaks-1-4-2011/31227/2 "2015-07-21T01:40:28Z")

</div>

I believe this is a default SmartyPants implementation, not our implementation. So the bug might be upstream for existing Ruby code…

---

<div class="post-metadata">

**Author:** ![GiraffeSilver](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/giraffesilver/32/42168_2.png) [@GiraffeSilver](https://meta.discourse.org/u/GiraffeSilver)\
**Post date:** [7월 21, 2015, 1:52오전 UTC](https://meta.discourse.org/t/title-prettify-should-be-respecting-word-breaks-1-4-2011/31227/3 "2015-07-21T01:52:37Z")

</div>

The fix is clearly to convince the entire world to using proper (iso 8601) dates. Everything else is just stopgapping.😝

---

<div class="post-metadata">

**Author:** ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)\
**Post date:** [7월 21, 2015, 2:39오전 UTC](https://meta.discourse.org/t/title-prettify-should-be-respecting-word-breaks-1-4-2011/31227/4 "2015-07-21T02:39:43Z")

</div>

Yes, but I daresay there will be more topics about April 1st… 😛

---

<div class="post-metadata">

**Author:** ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)\
**Post date:** [7월 22, 2015, 6:42오전 UTC](https://meta.discourse.org/t/title-prettify-should-be-respecting-word-breaks-1-4-2011/31227/5 "2015-07-22T06:42:27Z")

</div>

Raised:

[https://github.com/vmg/redcarpet/issues/506](https://github.com/vmg/redcarpet/issues/506)

the bug is here:

> <https://github.com/vmg/redcarpet/blob/master/ext/redcarpet/html_smartypants.c#L300>

In particular word boundary is defined as: `isspace(c) || ispunct(c);` , ispunct includes `/`

---

<div class="post-metadata">

**Author:** ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)\
**Post date:** [7월 22, 2015, 6:51오전 UTC](https://meta.discourse.org/t/title-prettify-should-be-respecting-word-breaks-1-4-2011/31227/6 "2015-07-22T06:51:38Z")

</div>

Yeah, because David/Gene/Edward does seem like a word break to me. You could specialize it to numbers and say a slash _between numbers_ is not a word break.

---

<div class="post-metadata">

**Author:** ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)\
**Post date:** [7월 22, 2015, 6:55오전 UTC](https://meta.discourse.org/t/title-prettify-should-be-respecting-word-breaks-1-4-2011/31227/7 "2015-07-22T06:55:29Z")

</div>

fixed via

[https://github.com/vmg/redcarpet/pull/507](https://github.com/vmg/redcarpet/pull/507)

waiting for it to be accepted

we are carrying a lot of GEM around for this 1 c file out of the 20 it ships

https://www.youtube.com/embed/ypn436DFTUQ?feature=oembed&wmode=opaque

---

<div class="post-metadata">

**Author:** ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)\
**Post date:** [9월 16, 2015, 7:03오전 UTC](https://meta.discourse.org/t/title-prettify-should-be-respecting-word-breaks-1-4-2011/31227/8 "2015-09-16T07:03:47Z")

</div>

Change is accepted, waiting on a stable release

---

<div class="post-metadata">

**Author:** ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)\
**Post date:** [9월 24, 2015, 3:39오전 UTC](https://meta.discourse.org/t/title-prettify-should-be-respecting-word-breaks-1-4-2011/31227/9 "2015-09-24T03:39:25Z")

</div>

This is now fixed per:

[https://github.com/discourse/discourse/commit/ffb8cb8caca2f0b73c480b96a2b753ef5866a91e](https://github.com/discourse/discourse/commit/ffb8cb8caca2f0b73c480b96a2b753ef5866a91e)

We no longer ship the Redcarpet gem, we have a pure Ruby implementation of title prettify that is included in our code base.

Before:

![](https://global.discourse-cdn.com/meta/original/3X/f/9/f938f1ace046a97020a5187696facc7846f04665.png)

After:

![](https://global.discourse-cdn.com/meta/original/3X/1/3/138e6733149cf8e5145bbaa61f2bef2734f589e9.png)

We no longer have to wait months for title prettify fixes.

---

<div class="post-metadata">

**Author:** ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)\
**Post date:** [9월 24, 2015, 4:00오전 UTC](https://meta.discourse.org/t/title-prettify-should-be-respecting-word-breaks-1-4-2011/31227/10 "2015-09-24T04:00:23Z")

</div>


