Forum: Ruby on Rails Bug in RedCloth or in my head?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
E6dd9cedee99f9d02e5f87d80ee0e681?d=identicon&s=25 Warren Seltzer (Guest)
on 2006-06-05 22:53
(Received via mailing list)
Instead of emm-dashes I get struck-out text surrounded with single
hyphens.   RedCloth
3.0.4:


>> d = RedCloth.new "-- hyphens to the left of me, hyphens to the right, all should be emm
dashes --"
=> "-- hyphens to the left of me, hyphens to the right, all should be
emm dashes --"
>> d.to_html
=> "<p><del>- hyphens to the left of me, hyphens to the right, all
should be emm dashes
-</del></p>"

There is a limit of one emm-dash per line -- ought to document this
restriction.


Warren Fred
Bc368ef524130e8d0deb386de961e24a?d=identicon&s=25 Suraj Kurapati (snk)
on 2006-11-06 19:07
Warren Seltzer wrote:
> Instead of emm-dashes I get struck-out text surrounded with single
> hyphens.   RedCloth
> 3.0.4:
>
>>> d = RedCloth.new "-- hyphens to the left of me, hyphens to the right, all should be 
emm
> dashes --"
> => "-- hyphens to the left of me, hyphens to the right, all should be
> emm dashes --"
>>> d.to_html
> => "<p><del>- hyphens to the left of me, hyphens to the right, all
> should be emm dashes
> -</del></p>"
>
> There is a limit of one emm-dash per line -- ought to document this
> restriction.

I see no technical reason for this limitation, because the Textism
tool[1] is able to handle more than one emdash per line. For example,
when I entered the above string into the Textism tool, it produced:

	<p>&#8212;hyphens to the left of me, hyphens to the right, all should
be emm dashes&#8212;</p>

In this manner, redcloth deviates from Textism's implementation of
textile. Thus, please fix this problem, so I can stop using &mdash;
entities all over my textile files -- making them look like (gasp!)
HTML. :-(

Thanks for your consideration.

[1] http://textism.com/tools/textile/index.php
5498d1507784752a878d7cf33be13f6a?d=identicon&s=25 Scott Mathieson (uberkorp)
on 2006-11-07 12:05
(Received via mailing list)
Using version 3.0.3

>> r = RedCloth.new "-- hyphens to the left of me --"
=> "-- hyphens to the left of me --"
>> r.to_html
=> "<p>&#8212;hyphens to the left of me&#8212;</p>"

3.0.4 is buggy in other places iirc (haven't used it since _I_ was
tripped
up) - and afaik it's on the backburner at the moment - stick with 3.0.3,
works fine.
This topic is locked and can not be replied to.