#159 ✓invalid
alexannese

Weird indentation problems.

Reported by alexannese | July 3rd, 2009 @ 11:51 AM

I installed RedCloth from the gem, and it works well in irb and script/console. It's converting in my app, but extra white space is added and really screws with more complex markup.

I tried taking off hard line breaks, but that didn't solve the problem.

I included a picture of the orignal text, it appears that ON SAVE, white space gets added to the markup, and when you try to edit the value, (t.text :page_text in my database), it displays the incorrect formatting.

Here is the HTML output, which looks normal.

      <p>
        <label for="page_page_text">Page text</label><br />
        <textarea cols="40" id="page_page_text" name="page[page_text]" rows="20">h1. hello
    h2. there

    # how
    # are
    # you</textarea>
      </p>

and:


{mkd-extraction-27751a927967b9e35484cbb45294a33d}

Comments and changes to this ticket

  • Andreas Neuhaus

    Andreas Neuhaus July 24th, 2009 @ 04:13 PM

    (Deleted at the request of the poster)

  • Andreas Neuhaus

    Andreas Neuhaus July 24th, 2009 @ 04:15 PM

    Darn, I didn't expect lighthouse to render [pre] tags of my comment. somebody please delete my messed up comment above. Sorry.

    The same happened to me. Are you using the haml plugin? Haml nicely formats HTML output by indenting child elements, which it does to make HTML output more readable I guess. The problem is, it also indents elements within CodeRay's [pre] output, which results in every code line (except the first one) being displayed indented in the browser since within a [pre] tag, whitespace does count.

    Btw, haml only does indentation in development mode. In production mode, it sets the :ugly template option, which skips the indentation. E.g. on my blog http://zargony.com/ source formatting looks fine while it looks terrible in development mode on my local machine.

  • Jason Garber

    Jason Garber July 27th, 2009 @ 08:59 AM

    • State changed from “new” to “invalid”

    Sorry, alexannese, I don't think the problem lies within RedCloth. RedCloth does add some indentation to lists and things when it outputs HTML, but not when just saving Textile to your database.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

RedCloth is a Ruby library for converting Textile into HTML

Shared Ticket Bins

People watching this ticket

Attachments

Tags

Pages