How to remove line break <br /> after quote box </quote>

For support and discussion related to templates, themes, and imagesets in phpBB 3.0.
Suggested Hosts
aqua_blue
Registered User
Posts: 43
Joined: Mon May 12, 2014 10:25 am

How to remove line break <br /> after quote box </quote>

Post by aqua_blue » Mon May 12, 2014 10:42 am

On the forum, by default two line gaps are inserted below the quote box with <br /><br /> tags. I want to remove one of these line gaps so that the gap between the quote box and the post/message text is equal to one line gap. I checked in includes/bbcode.php and styles/theme/template/bbcode.html but was not able to find the relevant code. Please see the image below for what I'm referring to and let me know how I can remove a single line gap from there.
Attachments
quote.PNG
quote.PNG (14.05 KiB) Viewed 2656 times
Last edited by aqua_blue on Fri May 30, 2014 9:13 pm, edited 1 time in total.

User avatar
Brf
Support Team Member
Support Team Member
Posts: 51785
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: How to remove line break <br /> after quote box </quote>

Post by Brf » Mon May 12, 2014 12:00 pm

aqua_blue wrote:On the forum, by default two line breaks are inserted below the quote box with <br /><br /> tags. I want to remove one of these <br /> tags
Test test test


Odd. I am not seeing any <br /> linebreaks at all here.

I also tested on my own board in subsilver2, and there was no <br /> inserted there either, although there was a margin about the size of a line:
Attachments
brfquote.jpg
brfquote.jpg (21.53 KiB) Viewed 2642 times

aqua_blue
Registered User
Posts: 43
Joined: Mon May 12, 2014 10:25 am

Re: How to remove line break <br /> after quote box </quote>

Post by aqua_blue » Mon May 12, 2014 12:50 pm

Brf wrote:
aqua_blue wrote:On the forum, by default two line breaks are inserted below the quote box with <br /><br /> tags. I want to remove one of these <br /> tags
Test test test


Odd. I am not seeing any <br /> linebreaks at all here.

I also tested on my own board in subsilver2, and there was no <br /> inserted there either, although there was a margin about the size of a line:
You tested it like this: [/quote]Test test test, which does not insert a line break. But people normally post in the following way with a single line gap after the quote:

Code: Select all

[/quote]

Test test test


and this adds a gap bigger than expected after the quote.

In other words, if my post syntax is:

Code: Select all

[/quote]

Test test test
Then the gap should be

Code: Select all

(QUOTE)

Test test test
NOT:

Code: Select all

(QUOTE)


Test test test
If it is a margin issue, where can I remove the margin?
Last edited by aqua_blue on Mon May 12, 2014 7:15 pm, edited 1 time in total.

User avatar
Brf
Support Team Member
Support Team Member
Posts: 51785
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: How to remove line break <br /> after quote box </quote>

Post by Brf » Mon May 12, 2014 1:11 pm

Stylesheet.css has this:

Code: Select all

.quotecontent, .attachcontent {
	margin: 0 5px 10px 5px;
	padding: 5px;
	border-color: #A9B8C2;
	border-width: 0 1px 1px 1px;
	border-style: solid;
	font-weight: normal;
	font-size: 1em;
	line-height: 1.4em;
	font-family: "Lucida Grande", "Trebuchet MS", Helvetica, Arial, sans-serif;
	background-color: #FAFAFA;
	color: #4B5C77;
}
You could probably replace that 10px of bottom margin with 0px.

As for the one<br /> you are getting, that is the way posting works. All of the "new line / carriage-return" are replaced by <br /> by design

aqua_blue
Registered User
Posts: 43
Joined: Mon May 12, 2014 10:25 am

Re: How to remove line break <br /> after quote box </quote>

Post by aqua_blue » Mon May 12, 2014 3:36 pm

Brf wrote:Stylesheet.css has this:

Code: Select all

.quotecontent, .attachcontent {
	margin: 0 5px 10px 5px;
	padding: 5px;
	border-color: #A9B8C2;
	border-width: 0 1px 1px 1px;
	border-style: solid;
	font-weight: normal;
	font-size: 1em;
	line-height: 1.4em;
	font-family: "Lucida Grande", "Trebuchet MS", Helvetica, Arial, sans-serif;
	background-color: #FAFAFA;
	color: #4B5C77;
}
You could probably replace that 10px of bottom margin with 0px.

As for the one<br /> you are getting, that is the way posting works. All of the "new line / carriage-return" are replaced by <br /> by design
Thanks, but even with the margin removed, that additional gap is displayed. If that is by design, then that design is faulty, it does not occur with any other forum software I have used. How can I remove that unnecessary gap from appearing? Even look just above this paragraph I am typing now, it is showing two line spaces, whereas I only placed one line space when typing this post.

aqua_blue
Registered User
Posts: 43
Joined: Mon May 12, 2014 10:25 am

Re: How to remove line break <br /> after quote box </quote>

Post by aqua_blue » Mon May 12, 2014 3:42 pm

Look at my above post carefully, I am attaching two screenshots now. Notice that in the post display, two line spaces are shown, whereas in the post editing window only one line space is inserted. This is faulty design.
Attachments
c1.PNG
c1.PNG (30.1 KiB) Viewed 2605 times
c2.PNG
c2.PNG (42.89 KiB) Viewed 2605 times

User avatar
Brf
Support Team Member
Support Team Member
Posts: 51785
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: How to remove line break <br /> after quote box </quote>

Post by Brf » Mon May 12, 2014 3:44 pm

I am seeing <br><br> in your view-source, both inside the quote and afterward. That would not have come from phpBB code.
PhpBB replaces line-breaks with <br />

Here in includes/functions_content.php:

Code: Select all

function bbcode_nl2br($text)
{
	// custom BBCodes might contain carriage returns so they
	// are not converted into <br /> so now revert that
	$text = str_replace(array("\n", "\r"), array('<br />', "\n"), $text);
	return $text;
}

aqua_blue
Registered User
Posts: 43
Joined: Mon May 12, 2014 10:25 am

Re: How to remove line break <br /> after quote box </quote>

Post by aqua_blue » Mon May 12, 2014 3:49 pm

Brf wrote:I am seeing <br><br> in your view-source, both inside the quote and afterward. That would not have come from phpBB code.
PhpBB replaces line-breaks with <br />

Here in includes/functions_content.php:

Code: Select all

function bbcode_nl2br($text)
{
	// custom BBCodes might contain carriage returns so they
	// are not converted into <br /> so now revert that
	$text = str_replace(array("\n", "\r"), array('<br />', "\n"), $text);
	return $text;
}
Please see my last post. The two <br /> after the quote appear even on this forum, as can be seen in my post here: viewtopic.php?p=13625806#p13625806

Please check the source code of that post and you will see the two <br /> there. So how is that not phpbb code?

User avatar
Brf
Support Team Member
Support Team Member
Posts: 51785
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: How to remove line break <br /> after quote box </quote>

Post by Brf » Mon May 12, 2014 3:59 pm

Well, yes. You put two line-breaks after the quote, so they are both converted to <br>s.
Attachments
The-Breaks.jpg
The-Breaks.jpg (22.68 KiB) Viewed 2582 times

aqua_blue
Registered User
Posts: 43
Joined: Mon May 12, 2014 10:25 am

Re: How to remove line break <br /> after quote box </quote>

Post by aqua_blue » Mon May 12, 2014 4:05 pm

Brf wrote:Well, yes. You put two line-breaks after the quote, so they are both converted to <br>s.
You are speaking in terms of code, but the ordinary members who use a forum are not coders, they just want to see the post as they type it. So when they place one line gap between two lines of text, they expect to see one line gap appear when they submit the post, not two lines gap. They don't think or care about <br /> tags. Can you please tell me how to fix this so that one line gap in the post editer equates to one line gap in the actual displayed post?

User avatar
Brf
Support Team Member
Support Team Member
Posts: 51785
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: How to remove line break <br /> after quote box </quote>

Post by Brf » Mon May 12, 2014 4:09 pm

As I said.... You typed in two line-breaks.
You pressed the "Enter" key twice when you typed the message, so you get two breaks.

My image is showing you the edit window where you typed in the message. It is showing you the two line-breaks that you entered.

aqua_blue
Registered User
Posts: 43
Joined: Mon May 12, 2014 10:25 am

Re: How to remove line break <br /> after quote box </quote>

Post by aqua_blue » Mon May 12, 2014 4:13 pm

Brf wrote:As I said.... You typed in two line-breaks.
You pressed the "Enter" key twice when you typed the message, so you get two breaks.

My image is showing you the edit window where you typed in the message. It is showing you the two line-breaks that you entered.
I am referring to line gap, not line breaks. There is an important distinction. In the image you are showing, there is one line gap / vertical space between the quote and the message, so obviously there should be one line gap in the displayed post. But instead there is two, why?

aqua_blue
Registered User
Posts: 43
Joined: Mon May 12, 2014 10:25 am

Re: How to remove line break <br /> after quote box </quote>

Post by aqua_blue » Mon May 12, 2014 4:24 pm

There is one line gap in your image, see below:
Attachments
one line.png
one line.png (26.25 KiB) Viewed 2549 times

aqua_blue
Registered User
Posts: 43
Joined: Mon May 12, 2014 10:25 am

Re: How to remove line break <br /> after quote box </quote>

Post by aqua_blue » Mon May 12, 2014 6:57 pm

If anyone else knows how to fix this, please post here.

User avatar
pit-PL
Registered User
Posts: 3085
Joined: Sat Nov 21, 2009 12:24 pm

Re: How to remove line break <br /> after quote box </quote>

Post by pit-PL » Mon May 12, 2014 8:32 pm

Maybe you and your users didn't notice yet but there is the "Preview" button next to "Submit".

Locked

Return to “[3.0.x] Styles Support & Discussion”