Is there a way in RedCloth to go from text with Textile markup in it to plain text without the markup? Not just <pre> or <notextile> that passes it through, but actually strips out the textile markup glyphs so something like *word* ends up just being word in the output? thanks. -- Posted via http://www.ruby-forum.com/.
No, not currently. You could write a plain text formatter like the HTML formatter in (the forthcoming) RedCloth 4.0. Then you rewrite the methods so it passes through the text you want but doesn''t add HTML. If you want to hack on it, fork the project on github and let me know when you have something interesting. Out of curiousity, what are you using this for? On Apr 23, 2008, at 3:56 PM, Cayce Balara wrote:> Is there a way in RedCloth to go from text with Textile markup in > it to > plain text without the markup? Not just <pre> or <notextile> that > passes > it through, but actually strips out the textile markup glyphs so > something like > > *word* > > ends up just being > > word > > in the output? > > thanks. > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Redcloth-upwards mailing list > Redcloth-upwards at rubyforge.org > http://rubyforge.org/mailman/listinfo/redcloth-upwards-------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/redcloth-upwards/attachments/20080423/59029a06/attachment-0001.html
The site I''m working on has a batch email function and I''d like the user to be able to user Textile for creating their HTML formatted email. However, I''ve set up action mailer to do multipart emails in case recipient is on a plain text client. So, for the HTML mailer template I use the .to_html output for the body text, and for the plain text mailer template I want to strip out the markup. Right now I''m just sending through the marked up text, which isn''t horrible if you keep it simple, but links, for instance, really come through badly. Thanks for the input. -- Posted via http://www.ruby-forum.com/.
Okay, that''s what I suspected. I have had that need at times too. Maybe it would be nice, instead of just outputting the text with no formatting, to do a little plain text formatting exclusively for human consumption (unlike Textile or Markdown). Like: Header 1 ====== This is a link (http://code.whytheluckystiff.net/redcloth) and perhaps some *bold* text. Now, you specifically *didn''t* want the asterisks around bold phrases, didn''t you? What do you think? On Apr 23, 2008, at 10:08 PM, Cayce Balara wrote:> The site I''m working on has a batch email function and I''d like the > user > to be able to user Textile for creating their HTML formatted email. > However, I''ve set up action mailer to do multipart emails in case > recipient is on a plain text client. So, for the HTML mailer > template I > use the .to_html output for the body text, and for the plain text > mailer > template I want to strip out the markup. > > Right now I''m just sending through the marked up text, which isn''t > horrible if you keep it simple, but links, for instance, really come > through badly. > > Thanks for the input. > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Redcloth-upwards mailing list > Redcloth-upwards at rubyforge.org > http://rubyforge.org/mailman/listinfo/redcloth-upwards
Not so much _I_ didn''t want the asterisks, but client does not like the output that way. I think I see what you''re getting at, though - would this be a matter of setting up custom RedCloth rules to apply the "plain text" formatting they want to end up with, and then perhaps a custom method to apply those rules instead of the normal ones, such as ".to_plain_formatted"? -- Posted via http://www.ruby-forum.com/.
Exactly. See the LaTeX formatter someone added and do likewise. On Apr 24, 2008, at 10:59 AM, Cayce Balara wrote:> Not so much _I_ didn''t want the asterisks, but client does not like > the > output that way. > > I think I see what you''re getting at, though - would this be a > matter of > setting up custom RedCloth rules to apply the "plain text" formatting > they want to end up with, and then perhaps a custom method to apply > those rules instead of the normal ones, such as ".to_plain_formatted"? > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Redcloth-upwards mailing list > Redcloth-upwards at rubyforge.org > http://rubyforge.org/mailman/listinfo/redcloth-upwards
Jason Garber wrote:> Exactly. See the LaTeX formatter someone added and do likewise.Coolio - will start working on that. Thanks for your help. -- Posted via http://www.ruby-forum.com/.
Cayce, any luck building that plain text formatter? I''ve got a "base" module that the other formatters build off of, but I''m thinking, "Hey, why not let them build off of a plain text formatter?" On Apr 24, 2008, at 10:59 AM, Cayce Balara wrote:> Not so much _I_ didn''t want the asterisks, but client does not like > the > output that way. > > I think I see what you''re getting at, though - would this be a > matter of > setting up custom RedCloth rules to apply the "plain text" formatting > they want to end up with, and then perhaps a custom method to apply > those rules instead of the normal ones, such as ".to_plain_formatted"? > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Redcloth-upwards mailing list > Redcloth-upwards at rubyforge.org > http://rubyforge.org/mailman/listinfo/redcloth-upwards
Excuses, excuses, where''s that box of excuses I keep around here somewhere... No, I haven''t. The particular client I was working with when I posted the question decided to go with plain text for their email function. The project for me to work on that formatter subsequently got moved to the back-burner behind some higher priority work. I still have aims to do it, because I know it''ll be needed in the future - I''ll notify on this thread when I get there. Jason Garber wrote:> Cayce, any luck building that plain text formatter? I''ve got a > "base" module that the other formatters build off of, but I''m > thinking, "Hey, why not let them build off of a plain text formatter?"-- Posted via http://www.ruby-forum.com/.