SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict DevilBear's Avatar
    Join Date
    Oct 2001
    Location
    Hades
    Posts
    301
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Two RedCloth questions

    Hi folks,

    First, thanks for everybody's help so far. I appreciate you all helping smooth my transition to Ruby & Rails.

    I've installed RedCloth and it's basically working... two things...

    One:

    This works fine:

    r = RedCloth.new @message.body

    but this:

    r = RedCloth.new @message.body, :filter_html

    returns

    undefined method `each' for :filter_html:Symbol

    /usr/local/lib/ruby/site_ruby/1.8/redcloth.rb:255:in `initialize'


    Two:

    When the submitted text contains a straight quote, e.g. " it's returning the appropriate entities. But when it contains curly quotes already, e.g. the user is pasting from Word into the form, RedCloth doesn't know to turn them into the appropriate entities.

    Has anyone addressed that, or do I need to code it myself?

  2. #2
    SitePoint Evangelist
    Join Date
    Jun 2004
    Location
    California
    Posts
    440
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    For #1: Try putting [] around the :filter_html, its probably expecting an Array.
    #2: You probably have to look up the ASCII code for curly quotes and code it in yourself. I do not have much experience with redcloth but it shouldn't be too difficult.
    Happy switcher to OS X running on a MacBook Pro.

    Zend Certified Engineer

  3. #3
    SitePoint Wizard DougBTX's Avatar
    Join Date
    Nov 2001
    Location
    Bath, UK
    Posts
    2,498
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by xmitchx
    For #1: Try putting [] around the :filter_html, its probably expecting an Array.
    Spot on, take a look at the docs: http://redcloth.rubyforge.org/classe...h.html#M000101
    Hello World


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •