New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

question - what is different or what needs to be set - <br> vs \n #3240

Open
Jimmi08 opened this Issue Jul 1, 2018 · 21 comments

Comments

Projects
None yet
4 participants
@Jimmi08
Contributor

Jimmi08 commented Jul 1, 2018

I have v1 site with this disclaimer:
image
each line is displayed on new line.

But the same content in version 2 is displayed in one line, no new line.
To get the same result, I needed to add
tags after each line.
Is this correct behaviour?

Thank you

@SimSync

This comment has been minimized.

Contributor

SimSync commented Jul 2, 2018

Yes, if you use TinyMCE on your new site and bbcode or just a textbox on your old site.
TinyMCE is a html editor and html doesn't know the new line charater that is used by bbcode or a plan textbox.
So you need to add the new line tag <br/> manually.

@Jimmi08

This comment has been minimized.

Contributor

Jimmi08 commented Jul 2, 2018

Oh, settings are the same, they do everything to have exact copy of v1 site.
I can check this at the evening (all sets are in Text rendering option, aren't?). I will ask them for screenshot from old site, I have access only to new one.

@SimSync

This comment has been minimized.

Contributor

SimSync commented Jul 2, 2018

Your screenshot shows bbcode. If you didn't change it, it was bbcode in v1 too.

@Jimmi08

This comment has been minimized.

Contributor

Jimmi08 commented Jul 2, 2018

yes, but parsing of this field was probably changed. Or I don't know... I notice somewhere setting to replace /n by
but it was in tinymce I think. When I know that it should work the same way, I will try to find what is different.

@SimSync

This comment has been minimized.

Contributor

SimSync commented Jul 3, 2018

From what i see in the v1 source, there is no special handling for \n (like conversion to <br/>) in case you load a post in the wysiwyg editor, that was originally written using bbcode.
What is done when you save a post from the wysiwyg editor is, that it will be surrounded by the [html] [/html] tags, to make sure it will be parsed as html when displaying on the website.

@Jimmi08

This comment has been minimized.

Contributor

Jimmi08 commented Jul 3, 2018

This is setting from new site: Tinymce is not installed either.

image

What I know - they just CTRL-C text from version 1 and copy it to sitedisclaimer field. Originally it was updated, but result was the same.

This is happened with forum posts too.

@Jimmi08

This comment has been minimized.

Contributor

Jimmi08 commented Jul 3, 2018

original setting from version 1:

image

@SimSync

This comment has been minimized.

Contributor

SimSync commented Jul 3, 2018

Just did some tests with the site disclaimer on my install here.
As long as the disclaimer doesn't contain any html tags, the \n where translated to <br/>.
Once i added a html tag (<i> in that case), the \n wasn't translated anymore and all was on one line.

That behaviour is definitely different against v1. Maybe @CaMer0n can say if this is a bug or a feature ...

@Moc Moc added this to the e107 2.1.9 milestone Jul 5, 2018

@Jimmi08

This comment has been minimized.

Contributor

Jimmi08 commented Jul 22, 2018

The updated forum (this is original of forum post, just bbcodes used)
http://www.outlawsracing.com/e107_plugins/forum/forum_viewtopic.php?4293.last
image

to version 2 (no WYSIWYG):
http://www.outlawsracing.xyz/e107_plugins/forum/forum_viewtopic.php?4293.last

  • it removed new lines

image

image

@CaMer0n

This comment has been minimized.

Member

CaMer0n commented Jul 22, 2018

I'd need to see the bbcode data (directly from the database), before and after upgrade, so I can test with it.

@Jimmi08

This comment has been minimized.

Contributor

Jimmi08 commented Jul 22, 2018

@CaMer0n Probably no problem, they say you did update. They will contact you soon.

@Jimmi08

This comment has been minimized.

Contributor

Jimmi08 commented Jul 24, 2018

I was able to narrow problem. I inserted bbcodes from version 2 to some my old forum and result is displayed correctly:
image

Example of data:

[center]<b><a href=&quot;http://www.teamviewer.com/en/download/windows.aspx&quot;title=&quot;DOWNLOAD TEAMVIEWER&quot; target=&quot;_self&quot;>[img]{e_IMAGE}custom/teamviewerblacksmall.png[/img]</a></b>[/center]

[color=#00ff00][size=22]rF2 Game[/size][/color]
[link=http://rfactor.net/web/rf2/rf2dl/][size=14]RFactor2 Main Website Link For Downloads Here[/size][/link]

[color=#00ff00][size=22]Outlaws Racing rF2 Event Packages [/size][/color] 
[link=https://mega.nz/#F!dBNl3IZJ!3Q8AxxylYFtLEswY6SbS7g][size=14]AM_FIAGT3_2012_0935[/size][/link]
[link=https://mega.co.nz/#F!8IFwyACL!rLVp8xU0g8h83pnDVgelsA][size=14]BTCC[/size][/link]
[link=https://mega.co.nz/#!RV1zHLiD!gQGmqjLX-Fqx8Ln7M4hT7FCKPVzTZV_g9OkhPqGpN4Y][size=14]BMWE90[/size][/link]
[link=https://mega.nz/#!VN9xybaD!M1X5GAoQ5cpLioeSjYflOw27BTR5930qmQ0zPgLH9HQ][size=14](Camaro)ISI_Chevrolet_CamaroGT3_2012_v1.61[/size][/link]
[link=https://mega.nz/#!QFUlTASa!Lt5RuNuxXImO8oxjUjSnHmDTfyXhm-3yV7KkMfygv2U][size=14]Celica_GTO v2.00[/size][/link]
[link=https://mega.nz/#!cEsACQZY!jfHb6goEwsN91WEah61p7wWMHkHFkfcNqGv8jFU4-eQ][size=14](Covette)ISI_Corvette_C6RGT2_2009_v1.62[/size][/link] *^(/)
[link=https://mega.co.nz/#F!QBUH1aqQ!bAE1cL6rWTQwR5IBiZ828g][size=14]DTM T5s[/size][/link]
[link=https://mega.nz/#!QIVimAgD!ksTiwI-OoJfiJEgpBC72Omavzjsop1KPYhMW5jXz4lM][size=14]Endurance Series[/size][/link]    

I think that something is going wrong because this: [center]

@CaMer0n

This comment has been minimized.

Member

CaMer0n commented Jul 24, 2018

This is helpful, thank you @Jimmi08

@CaMer0n

This comment has been minimized.

Member

CaMer0n commented Jul 24, 2018

@Jimmi08 You have HTML mixed with BBCODEs. I believe this is your problem.

[center]<b><a href=..
@Jimmi08

This comment has been minimized.

Contributor

Jimmi08 commented Jul 24, 2018

@CaMer0n there are over 7000 forum posts, why this wasn't problem before?

@CaMer0n

This comment has been minimized.

Member

CaMer0n commented Jul 24, 2018

@Jimmi08 Because there was a security hole in earlier versions which has since been patched.

@Jimmi08

This comment has been minimized.

Contributor

Jimmi08 commented Jul 25, 2018

@CaMer0n

This is just display, data are already saved. I get this check when you post data. But if you forbid html mixed with bbcodes, what is purpose of this preference?

image

@SimSync

This comment has been minimized.

Contributor

SimSync commented Jul 25, 2018

In my memory, I remember a post with just bbcode will translate newline to br. A HTML or HTML mixed with bbcode (or the other way around) has ignored the newline and you had to manually add br to it. But my v1 days are already a long time ago and I may be wrong...

@Jimmi08

This comment has been minimized.

Contributor

Jimmi08 commented Jul 25, 2018

@SimSync I have no idea. I just can't tell somebody with 7000 posts to rewrite them manually. They will stick with version 1 because this.

br tags are missing at all if you have mixed content.

V1: 2x br tag if you use html, 1x br after [link]
image

v2: no br tags
image

I thought that something was wrong with update but it's not this case.

If I remove that html part, links works correctly [links] is replaced with <br>. So why it messes all content not only that html part?

And this is reason why I can't switch from tinymce to bbcodes (to set wysiwyg off) - all newlines are ignored and text is messed then. And I am sure that there is setting for tinymce - convert newlines to br.

@Jimmi08

This comment has been minimized.

Contributor

Jimmi08 commented Jul 30, 2018

I found reason:

		if($this->isHtml($text)) //BC FIx for when HTML is saved without [html][/html]
		{
			$opts['nobreak'] = true;
			$text = trim($text);
		}

and then:

		if(preg_match('#(?<=<)\w+(?=[^<]*?>)#', $text))
		{
			return true;
		}

It removes lines if I put html code inside <code> tag too.

@CaMer0n CaMer0n modified the milestones: e107 2.1.9, e107 2.2.0 Aug 22, 2018

@Jimmi08

This comment has been minimized.

Contributor

Jimmi08 commented Sep 2, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment