Line breaks not working in Offroad theme?


(Jeff Harrison) #1

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?


Off road theme and sale information
(Ruffin) #2

Big time +1 here. I’m assuming something 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 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.


(Ruffin) #3

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, and that 404s. (Actually, it doesn’t even 404. It’s just nothing.)

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


(Jeroen Roos) #4

@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.


(Ruffin) #5

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 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.

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. ;^)


(Ruffin) #6

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 }

(Nathalie) #7

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!


(Sergio) #8

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!


(Doug Bennett) #9

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

https://themeflood.com

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.