# Line breaks not working in Offroad theme?

**URL:** <https://forums.realmacsoftware.com/t/line-breaks-not-working-in-offroad-theme/7577>\
**Category:** RapidWeaver Classic\
**Created:** [June 4, 2016, 9:37pm UTC](https://forums.realmacsoftware.com/t/line-breaks-not-working-in-offroad-theme/7577 "2016-06-04T21:37:15Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeffhrsn](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/jeffhrsn/32/29711_2.png) [@jeffhrsn](https://forums.realmacsoftware.com/u/jeffhrsn)\
**Post date:** [June 4, 2016, 9:37pm UTC](https://forums.realmacsoftware.com/t/line-breaks-not-working-in-offroad-theme/7577/1 "2016-06-04T21:37:15Z")

</div>

On a styled text page in 7.0.1 and even the latest beta, I can’t get line breaks in my text to show up properly in the Offroad theme. If I switch to another theme it shows up as expected.

Bug or something I’m doing wrong?

---

<div class="post-metadata">

**Author:** ![ruffin](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/ruffin/32/4982_2.png) [@ruffin](https://forums.realmacsoftware.com/u/ruffin)\
**Post date:** [August 17, 2016, 12:38am UTC](https://forums.realmacsoftware.com/t/line-breaks-not-working-in-offroad-theme/7577/2 "2016-08-17T00:38:34Z")

</div>

Big time +1 here. I’m assuming [something](http://stackoverflow.com/questions/7596647/ignore-br-with-css) is pulling out the break of the linebreak in CSS, but man oh man consolidated.css is HUGE. ;^) I don’t think br is in there either, though, after a quick search and a Chrome beautify.

It is strange. I have the `<br>`s in my source, and view source in Chrome shows they’re there, but inspect element in Chrome shows no `br` tags at all.

**EDIT:** Looks like [this](http://stackoverflow.com/a/9185216/1028230) is a decent replacement…

```
<style>
	.fauxBr { display:block }
</style>

<p><a name="top"></a></p>

<p>
<span class="fauxBr">1.)&nbsp;&nbsp;<a href="#answer0">What is Markdown?</a></span>
<span class="fauxBr">2.)&nbsp;&nbsp;<a href="#answer1">How can I learn Markdown?</a></span>
<span class="fauxBr">3.)&nbsp;&nbsp;<a href="#answer2">Does MarkUpDown support any nonstandard Markdown?</a></span>

```

Still would like to know why it’s acting like this, though.

---

<div class="post-metadata">

**Author:** ![ruffin](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/ruffin/32/4982_2.png) [@ruffin](https://forums.realmacsoftware.com/u/ruffin)\
**Post date:** [August 17, 2016, 2:32pm UTC](https://forums.realmacsoftware.com/t/line-breaks-not-working-in-offroad-theme/7577/3 "2016-08-17T14:32:25Z")

</div>

Yeah, so the blog format isn’t great. I hadn’t used the Blog module before, but shouldn’t this be a styled text editor?

Is there a better place to get support about the pack-in themes? There’s a menu item for “Offroad support”, but it goes to [http://help.realmacsoftware.com](http://help.realmacsoftware.com), and that 404s. (Actually, it doesn’t even 404. It’s just nothing.)

 ![](https://europe1.discourse-cdn.com/flex005/uploads/realmacsoftware1/original/2X/1/1ebf606e5e062ec0d5b2ccc66ea82f5b49bd31c0.png)

(Sorry for wack image; apparently new users can only post one image per post)

---

<div class="post-metadata">

**Author:** ![el\_mourabbi](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/el_mourabbi/32/582_2.png) [@el\_mourabbi](https://forums.realmacsoftware.com/u/el_mourabbi)\
**Post date:** [August 17, 2016, 3:13pm UTC](https://forums.realmacsoftware.com/t/line-breaks-not-working-in-offroad-theme/7577/4 "2016-08-17T15:13:27Z")

</div>

@ruffin: it’s not the CSS, something in the JavaScript is removing all `<br>`s and `<hr>`s.

I had a conversation about this with Dan last May, and he told me that the developer ‘removes them to tidy up some of RW’s output.’.

I think your workaround is a little cumbersome, but at least it works for line breaks.

---

<div class="post-metadata">

**Author:** ![ruffin](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/ruffin/32/4982_2.png) [@ruffin](https://forums.realmacsoftware.com/u/ruffin)\
**Post date:** [August 17, 2016, 4:14pm UTC](https://forums.realmacsoftware.com/t/line-breaks-not-working-in-offroad-theme/7577/5 "2016-08-17T16:14:18Z")

</div>

Wow. That’s super user-unfriendly, and not horribly thought through. I would’ve never expected someone to use JavaScript to be so aggressive in the DOM.

But that appears to be the issue. You’re spot on – thanks.

It’s right on this line, edited out, below:

```
if (
    $(".site-logo img").width(t / 2),
    //$("br").remove(), 
    $(".thumbnail-wrap, .thumbnail-frame").attr("style", ""), 
    $(".photo-frame")[0]
) { //...

```

I didn’t play around long enough (minified files are a pain) to see why they’d do this, or do it in this spot, but wow. I’d understand having a better selector there, if it’s a theme-specific hack, like this…

```
if (
    $(".site-logo img").width(t / 2),
    $("br").not(".site-content-inner br").remove(), // <<< EDIT MADE HERE! -RUF
    $(".thumbnail-wrap, .thumbnail-frame").attr("style", ""), 
    $(".photo-frame")[0]
) {

```

That’s much less aggressive, as it leaves (most?) user-generated content alone. Still unexpected, but so much less aggressive.

That said, I’d like to see what that removal was doing in the first place. Commenting the line all the way out seemed to display just fine as well in the few pages I have up. Rendering all `<br />` tags useless doesn’t seem like a great idea. Better still to remove br’s from the theme where they’re not needed, or _very selectively_ target the br’s RW injects (if that’s what’s going on) to replace only the offenders.

Anyhow, [here’s a pastebin](http://pastebin.com/EHszkrNj) of a “beautified” version of the minified javascript.js file that comes with Offroad with that new `not` selector added on line 3247. It can be used to replace the `javascript.js` file in the `rw_common>themes>offroad` folder. Pretty sure you can edit the themes still in RW7, though you might want to minify before putting this in there permanently.

![](https://europe1.discourse-cdn.com/flex005/uploads/realmacsoftware1/original/2X/4/4f5b35270d331e47a300024e0614a3e0f24906c6.png)

Thanks again. I do wacky stuff with JavaScript, but I’d’ve never thought to look there for something this destructive. I’d almost always blame a designer… first. ;^)

---

<div class="post-metadata">

**Author:** ![ruffin](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/ruffin/32/4982_2.png) [@ruffin](https://forums.realmacsoftware.com/u/ruffin)\
**Post date:** [August 17, 2016, 4:37pm UTC](https://forums.realmacsoftware.com/t/line-breaks-not-working-in-offroad-theme/7577/6 "2016-08-17T16:37:34Z")

</div>

Actually, I think the smarter move is still to remove the JavaScript and push this into CSS, if it’s really needed, but hopefully making the first selector _much_ more specific and targeted.

```
br { display:none }
.site-content-inner br { display:inline }
```

---

<div class="post-metadata">

**Author:** ![amaryl](https://avatars.discourse-cdn.com/v4/letter/a/e79b87/32.png) [@amaryl](https://forums.realmacsoftware.com/u/amaryl)\
**Post date:** [January 9, 2017, 12:15pm UTC](https://forums.realmacsoftware.com/t/line-breaks-not-working-in-offroad-theme/7577/7 "2017-01-09T12:15:30Z")

</div>

Hi Ruffin,

Thank you so much for your posts about line breaks in Offroad theme. I use RW Version 7.0.4 (El Capitan). I replaced the javascript like you suggested by your improved version in the assets. But still am unable to add line breaks in the sidebar, for instance. It looks like before. What am I doing wrong? I am a very unexperienced RW user and would really appreciate some help. I’m desperate… Thanks a lot!

---

<div class="post-metadata">

**Author:** ![Dormouse75](https://avatars.discourse-cdn.com/v4/letter/d/6a8cbe/32.png) [@Dormouse75](https://forums.realmacsoftware.com/u/Dormouse75)\
**Post date:** [February 24, 2018, 12:24pm UTC](https://forums.realmacsoftware.com/t/line-breaks-not-working-in-offroad-theme/7577/8 "2018-02-24T12:24:23Z")

</div>

HI,  
I can replace or remove javascript from Theme rw\_common files but it solves the problem after an export, and the line breaks are present only in published site…but not on “preview” during site development…  
Is there other way to modify “off road” theme in order to find line breaks also in preview? Thanks!

---

<div class="post-metadata">

**Author:** ![teefers](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/teefers/32/8173_2.png) [@teefers](https://forums.realmacsoftware.com/u/teefers)\
**Post date:** [February 24, 2018, 1:10pm UTC](https://forums.realmacsoftware.com/t/line-breaks-not-working-in-offroad-theme/7577/9 "2018-02-24T13:10:50Z")

</div>

> [@Dormouse75](#):
>
> rw\_common

You would need to find and modify the theme itself. The modification you are doing now is to files the export/publishing creates.  
Modifying themes is kinda difficult to do, and wouldn’t recommend it unless you’re comfortable with coding.

You could pick a different theme, there’s lots to choose from.  
Might want to check out some of @willwood themes, they all have a free demo version so you can try before you buy.  
He has both these sites

> **[ThemeFlood | Free & Premium RapidWeaver Themes](https://themeflood.com)**
>
> Quality free and premium RapidWeaver themes for use in personal and commercial websites, by UK web developer Will Woodgate.

[https://seydesign.com/themes/](https://seydesign.com/themes/)

Of course the coder in me wants to point out that using line breaks `<br>` for major formatting isn’t good technique. HTML/CSS should be using padding/ margins etc.

---

<div class="post-metadata">

**Author:** ![peglomaniac](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/peglomaniac/32/11510_2.png) [@peglomaniac](https://forums.realmacsoftware.com/u/peglomaniac)\
**Post date:** [January 13, 2022, 10:39pm UTC](https://forums.realmacsoftware.com/t/line-breaks-not-working-in-offroad-theme/7577/10 "2022-01-13T22:39:20Z")

</div>

Hi, any development on this issue?

I am using the Offroad Theme and was just about to pose this question but I see there is no need to reinvent the wheel.

I am happy with the rest of the theme so really don’t want to choose another & tweak all my content to make sure it works with another theme, nor do I feel like messing with code for this.

Has there been an answer from RapidWeaver? Offroad is a RW theme.

Thanks anyone who can shed any light
