Limiting markdown/textile

I’m using RedCloth for a forum type app. I want users to have control
over the look of their posts, but within limits. For example, I don’t
want them to be able to include images or use header tags. The RedCloth
documentation is pretty thin and I don’t feel it’s very explanatory.
I’m wondering if there’s any easy way to do this? Or do I have to make
my own markup from scratch? I’m trying to avoid this at all costs,
because I suck at regex. I also feel that duplicating the functions of
already-existent code is kind of stupid.

Eleo wrote:

I’m using RedCloth for a forum type app. I want users to have control
over the look of their posts, but within limits. For example, I don’t
want them to be able to include images or use header tags. The RedCloth
documentation is pretty thin and I don’t feel it’s very explanatory.
I’m wondering if there’s any easy way to do this? Or do I have to make
my own markup from scratch? I’m trying to avoid this at all costs,
because I suck at regex. I also feel that duplicating the functions of
already-existent code is kind of stupid.

Well, you’ll probably have to use regexs since I don’t know if there’s a
way to limit tags in Redcloth. But it’s probably simply a matter of
doing /\sh[0-5]\s// and similar before saving their posts.

Joe

Also remember that I don’t believe either RedCloth nor BlueCloth
remove HTML tags from input. So you would always have to parse the
data using regexp anyway to remove that.

On 7/18/06, Eleo [email protected] wrote:

Posted via http://www.ruby-forum.com/.


Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails

Jón Borgþórsson wrote:

Also remember that I don’t believe either RedCloth nor BlueCloth
remove HTML tags from input. So you would always have to parse the
data using regexp anyway to remove that.

On 7/18/06, Eleo [email protected] wrote:

Posted via http://www.ruby-forum.com/.


Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails

RedCloth can remove HTML tags from the original input. I can also
easily do this with h() before or after saving to the database.

My bad. Didn’t know about that extra feature.

On 7/18/06, Eleo [email protected] wrote:

http://lists.rubyonrails.org/mailman/listinfo/rails


Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs