[typo] A possibly dumb question...

Piers Cawley pdcawley at bofh.org.uk
Tue Dec 6 07:07:33 EST 2005

Rodger Donaldson <rodgerd at diaspora.gen.nz> writes:

> On Tue, Dec 06, 2005 at 08:49:59AM +0000, Piers Cawley wrote:
>> rodgerd at diaspora.gen.nz writes:
>> > With a typo 2.6 install, I see properly formed hyperlinks in comments on
>> > blog entries are being rendered as plain text.  The comments filter is set
>> > to Markdown with Smartypants.
>> >
>> > Bug?  Feature?  User error?
>> A glance at test/functional/articles_controller_test.rb seems to imply
>> it's a bug.  
>> Looking at the implementation of
>> ArticlesControllerTest#test_comment_spam1 I reckon a new test along
>> the lines of this should expose any bug.
>>   def test_comment_spam_with_markdown_smartypants
>>     settings[:comment_text_filter] = "markdown smartypants"
>>     test_comment_spam1
>>   end
>> Where 'test_comment_spam1' takes a string with a well formed link in
>> it and simply turns it into a 'nofollow' link (and adds <p>...</p>
>> wrappers round the string).
>> I'll have a proper look later.
> Along those lines, it's also (I notice) adding another nofollow
> attribute every time the comment is edited, irrespective of whether
> there's already one there.

I'm surprised it's adding one every time, since the html *should* be generated
from the unformatted body (which is (or should be sacrosanct)). But nofollowify
is definitely in the 'ugly hack' category of html modification. Having looked
at its  implementation I can think of all sorts of ways to break it in an
entertaining fashion (I think a suitably crafted atrribute could let a spammer
avoid the nofollow for instance.)

I shall be having a play later.

Piers Cawley <pdcawley at bofh.org.uk>

More information about the Typo-list mailing list