News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Line Spacing Removed

Started by slizzie1986, February 18, 2019, 12:58:12 PM

Previous topic - Next topic

slizzie1986

Hi.

The writers and I are experiencing an issue on my forum. When we pasted in a chapter to post the lines\spaces between paragraphs are removed. Some times it also adds in code ie [size] when I go back in to manually add the spaces. This happens over several different themes. Other formatting seems to stay intact.

I'm running version 2.0.15 of SMF. I've attached a screenshot here for an example. Thanks in advance for any help.

drewactual

i use what's considered an illegal rule to manage this for my own instance.

in the very post above (yours), if you are to look at the code generating it you'll see:


<div class="inner" id="msg_4007670">Hi.<br /><br />The writers and I are experiencing an issue on my forum. When we pasted in a chapter to post the lines\spaces between paragraphs are removed. Some times it also adds in code ie [size] when I go back in to manually add the spaces. This happens over several different themes. Other formatting seems to stay intact.<br /><br />I&#039;m running version 2.0.15 of SMF. I&#039;ve attached a screenshot here for an example. Thanks in advance for any help. </div>
</div>


assigning a css rule to line breaks ( 'br /') is not permitted, though it has been toyed with by the W3C consortium for a while.  as it turns out, most browsers will in fact render it using the rules you provide. 

so... if you'd like to give it a shot, try adding this to your theme's css:


.inner #msg br{
                  line-height:1.5; /*if you want basically one and a half spaces in between breaks*/
                  /* line-height: 2; de-comment this one if you want two full spaces, and comment out the one above*/
                  }


is it pretty?  yeah, actually it is... is it correct? sorta, leaning on not really... will it work? yup... is there a better solution? yes... upgrade to 2.1RC1 which uses the superior WYSIWYG editor, or use one of the paid for editors from smfhacks or smfpacks... if you just want to eliminate that one issue presented by the 2.0 current WYSIWYG editor, you can use the css cheat provided. 

IF you choose to use the css cheat, it will work on all the major browsers AND, you can also build in some indentation easier than attempting to force it, with simple padding rules.

Arantor

Weird, an unmodified 2.0 works as expected, I wonder what mods are breaking it.

slizzie1986

Thanks for your suggestion, drewactual! It doesn't seem to be working though. Is there a specific spot I should insert the code? My board is only a couple months old so I am fairly new to this.

I didn't realize 2.1 had a stable release. I will definitely look into that.

Arantor, this issue has only started over the weekend and I haven't added any new Mods. I'll admit I am a beginner with coding and have tried to modify some lines in CSS files, but only on one theme so I don't understand how this could carry over like it has.  :-[ Would it help to see the CSS files?

Illori

SMF 2.1 is not at a stable release yet.

slizzie1986

#5
Oh, ok. Thanks for the info. I must have gotten a little confused. Guess I will be sticking with 2.0.15 until that happens.

Arantor

Quote from: slizzie1986 on February 18, 2019, 05:18:57 PM
Arantor, this issue has only started over the weekend and I haven't added any new Mods. I'll admit I am a beginner with coding and have tried to modify some lines in CSS files, but only on one theme so I don't understand how this could carry over like it has.  :-[ Would it help to see the CSS files?

Symptoms do not just start appearing - something must have changed.

drewactual

yuppers... seeing the css file will help, Sir.

slizzie1986

Sorry, Arantor. Poor choice of words on my part. I should have said that I was alerted to the issue over the weekend. I posted a chapter last week and it was formatting fine. The only thing that changed in that timeframe that I am aware of are the CSS files. I'll attach a screenshot of the MODs we are using.


Thanks, drewactual. I have attached the CSS files.

drewactual

lose the #msg from what i sent last time... in mean time, share a link to your site?  losing the "#msg" should let it work, but i'd like to see.

slizzie1986

#10
It's not working with the #msg removed. I wonder if I have something in the code is overriding it.



Edited to delete link.

Kindred

oh, ugh.....   turn off the ancient, useless "pretend to be an html page" option...
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

drewactual

yeah i can't get in...

do this... navigate to your forum, open a thread, select the first several words of a post... copy it... right click select 'view source', then search for the text on your clipboard (you copied)... once you've found it, select and copy to clipboard the entire post, as well as the six or so lines above and below it... come back here and make a post, use the 'code#' bbc, and paste it.

line-height:x is the only rule allowed in an hr, and it should work without issue once we discover what the structure is your theme uses. 

Illori

Quote from: slizzie1986 on February 19, 2019, 05:02:19 PM
Here's a link. The board is mostly members only, but you should be able to access this forum: http://www.liasonitesgathering.online/Forum/index.php/board,1.0.html

that board does not allow guests to view, you dont allow guests to view anything.

slizzie1986

I edited the link once I figured out the setting to switch.  Sorry, I am new to all this. I thought I changed to let guests in... My partner on the site is pretty security minded. Again sorry.

Thanks for being so patient with me, drewactual. I can be a dunce sometimes. This is the code is wrapped around the post content
<div class="inner" id="msg_488"></div>

drewactual

if you open your CSS file, and add to the bottom this line:


.inner br{line-height:1.5;}


you should see some space added between your lines.. if you're not happy with the 1.5 line spacing, more can be added by making it 2, or 2.5, or whatever suites your needs. 

once that is done, hold your shift key and hit refresh or h5 to dump any cached css or other files that may be stopping you from seeing the change. 

Advertisement: