Where'd the line breaks go?
October 2, 2006 7:32 PM   Subscribe

CSSFilter: In my Wordpress theme, enclosing text in <blockquote> tags gets rid of all the line breaks. I don't want to go back and put <br /> tags all over the place; what can I change in the CSS to make it so that, when I hit return a couple of times, it shows up as a blank line when I publish my posts?
posted by danb to Computers & Internet (8 answers total)
 
You could try putting "white-space:pre" in the CSS. I'm not sure it won't have unintended consequences, but it will definitely make every return into a line beak.
posted by cerebus19 at 7:48 PM on October 2, 2006


Sounds strange to me. Probably the theme author has a style rule for paragraphs inside blockquotes that eliminates the tom and bottom padding; check for a style selector like "blockquote p" or "blockquote > p" (I haven't quite memorized the CSS2 selectors so I don't remember exactly how those two are different, but they should both select paragraph child elements inside blockquote elements).

If that doesn't sort you out, there might be more complex CSS causing the problem. Oh, and before you go digging around the CSS, double-check the HTML source code Wordpress produces when you publish a post. As far as I know, Wordpress should automatically insert paragraph elements properly even inside blockquotes, but there's always the slight chance something has gone horribly wrong.
posted by chrominance at 7:51 PM on October 2, 2006


Response by poster: cerebus19: That worked to create line breaks, but it made the text ignore the div it was inside of and it spread across the rest of the page. There are those unintended consquences, I suppose. :)

chrominance: I checked the source, and you nailed it -- there are no paragraph elements inside the blockquote. So something has gone horribly wrong, evidently. Any idea what I can do?
posted by danb at 8:08 PM on October 2, 2006


Response by poster: After more experimenting:

- If I manually add <p> tags around all the paragraphs in my blockquote, it works. I never had to do that with other themes, though...
- Enclosing text in <code> tags causes the same problem as <blockquote>.
posted by danb at 8:15 PM on October 2, 2006


Huh. I'll be honest, I wasn't actually expecting that result.

First things first: switch back to the default theme and re-check the HTML. If the paragraph tags pop back up, then at least you know it's the theme's fault, and not the Wordpress installation.

Generally themes don't touch the post text at all aside from CSS, but some of the more complex ones like K2 do all sorts of funky stuff. I'd look in the templates to see if your post text is being passed through any custom filters to make the paragraph tags disappear. (What theme are you using, by the way?)
posted by chrominance at 8:43 PM on October 2, 2006


Response by poster: Okay, now I'm really confused. I switched to the default theme (and to a bunch of other themes), and none of them worked right. But I know that I didn't always put <br>s all over my blockquotes. I tried updating to the latest WP, but to no avail.

The theme that I thought was causing the problem is Hemmed, for what it's worth. It doesn't do any of the crazy shit that K2 does, so I'm not sure where this came from...
posted by danb at 9:38 PM on October 2, 2006


Best answer: Cockass on a stick. You know what fixed it? Disabling the Markdown plugin. I guess I turned it on by accident at some point? Whatever. I have a headache now.

Thanks for your ideas, everyone.
posted by danb at 9:52 PM on October 2, 2006


Best answer: #@&%ing markdown!
posted by register at 12:01 AM on October 3, 2006 [2 favorites]


« Older What stores are ranked directly below Wal-Mart?   |   Suggestions for photofinishing in Vancouver? Newer »
This thread is closed to new comments.