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. -- Posted via http://www.ruby-forum.com/.
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 -- Posted via http://www.ruby-forum.com/.
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 <sireleo@gmail.com> 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. > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- -------------- Jon Gretar Borgthorsson http://www.jongretar.net/
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 <sireleo@gmail.com> wrote: >> Posted via http://www.ruby-forum.com/. >> _______________________________________________ >> Rails mailing list >> Rails@lists.rubyonrails.org >> 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. -- Posted via http://www.ruby-forum.com/.
My bad. Didn''t know about that extra feature. On 7/18/06, Eleo <sireleo@gmail.com> wrote:> 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 <sireleo@gmail.com> wrote: > >> Posted via http://www.ruby-forum.com/. > >> _______________________________________________ > >> Rails mailing list > >> Rails@lists.rubyonrails.org > >> 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. > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- -------------- Jon Gretar Borgthorsson http://www.jongretar.net/