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


(Sam Saffron) #1

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

Is rendered as:

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


(Jeff Atwood) #2

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


#3

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


(Kane York) #4

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


(Sam Saffron) #5

Raised:

https://github.com/vmg/redcarpet/issues/506

the bug is here:

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


(Jeff Atwood) #6

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.


(Sam Saffron) #7

fixed via

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


(Sam Saffron) #8

Change is accepted, waiting on a stable release


(Sam Saffron) #9

This is now fixed per:

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:

After:

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


Nested quotation marks in title aren't rendered correctly
(Sam Saffron) #10