Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion wiki markup pain
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Waylan Limberg  
View profile  
 More options Jul 1 2009, 2:14 pm
From: Waylan Limberg <way...@gmail.com>
Date: Wed, 1 Jul 2009 11:14:39 -0700 (PDT)
Local: Wed, Jul 1 2009 2:14 pm
Subject: Re: wiki markup pain

On Jun 30, 5:20 am, Johan Sørensen <jo...@johansorensen.com> wrote:

> But you probably know more about Markdown than I do.

I do know that most implementations have a HTML sanitizer built in to
avoid these kinds of problems. In fact, it appears that RDiscount does
- which you should be using instead of sanitizing it yourself. I
finally looked at the code to see what Gitorious was doing.

Now, I'm not all that familiar with ruby and haven't tested this, but
I believe you want to make this change:

--- app/helpers/pages_helper.rb 2009-06-23 08:54:31.000000000 -0400
+++ app/helpers/pages_helper.rb 2009-07-01 14:04:08.000000000 -0400
@@ -22,7 +22,7 @@

   def wikize(content)
     content = wiki_link(content)
-    rd = RDiscount.new(sanitize(content), :smart, :generate_toc)
+    rd = RDiscount.new(content, :smart, :filter_html, :generate_toc)
     content = content_tag(:div, rd.to_html, :class => "page-content")
     toc_content = rd.toc_content
     if !toc_content.blank?

Notice that I removed the call to `sanitize` (which is not markdown
aware and causing the problem) and added the `:filter_html` attribute.
The builtin html filter should accomplish the same thing as sanitize,
but in a way that won't break the markdown syntax.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.