Post formatting changes upon hittin save

Started by angelclawdust, March 24, 2012, 05:58:26 AM

Previous topic - Next topic

angelclawdust

hello there
im not sure if it is a bug tbh but well soon see :D
in a post on my forum i have a list of names and teams next to each other
the names are one colour and the teams another colour
whenever i need to go edit the names in this post i click save and uit then changes the colours around and mixes them up
i then edit it bck to how it should look and upon next click it moves them all onto the same line and also displays the [/b] - ie end tags of bb code randomly in the post

is this an actual bug or is it something to do with my host server - or simply the browser (im using firefox latest version - other admin uses chrome with no issues)
latest forum version also
and default theme

emanuele

Hello angelclawdust,

thanks for the report.

A couple of questions:
1) are you using the WYSIWYG editor?
2) can you post (within the [code][/code] tags) an example of what you have in your post and maybe the result after the edit?


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

angelclawdust

hello
yes currently using the wysig editor

an example is - i goto post the following
hello there and welcome to the test post
this will test to see how it all goes upon hitting post

so we shall colour this part red and bold it
man utd
man city
leeds
notts forest
sweden
germany

bold this part
bob
sam
tom
ian
frankie


and this shall stay normal unformatted text


but upon hitting save it outputs the following
hello there and welcome to the test post
this will test to see how it all goes upon hitting post

so we shall colour this part and bold it
man utd[/color]man cityleedsnotts forestswedengermany

bold this part
bobsamtomianfrankie


and this shall stay normal unformatted text


and then upon modify again itll either post correctly of mess up some more

emanuele

Welcome to the WYSIWYG mess with browsers! :P

Forgot to say:
* emanuele hates WYSIWYG editor!! :P

Confirmed with Firefox 11, not tested with previous versions.

* emanuele goes check with the development version too

ETA: yep, confirmed in devel too...


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

emanuele

Okay, here there are two things that need fixes.
In html_to_bbc:
1) this (and all the other similar)
$curCloseTags .= '[/b]';
$replacement .= '[b]';

should be instead:
$curCloseTags = '[/b]' . $curCloseTags;
$replacement .= '[b]';

2) FF11 apparently (don't know if previous versions too) applies styles line-by-line, that means something like:
so we shall colour this part red and bold it<br>
<span style="color: red; font-weight: bold;">man utd</span><br style="color: red; font-weight: bold;">
<span style="color: red; font-weight: bold;">man city</span><br style="color: red; font-weight: bold;">
<span style="color: red; font-weight: bold;">leeds</span><br style="color: red; font-weight: bold;">
<span style="color: red; font-weight: bold;">notts forest</span><br style="color: red; font-weight: bold;">
<span style="color: red; font-weight: bold;">sweden</span><br style="color: red; font-weight: bold;">
<span style="color: red; font-weight: bold;">germany</span>

while all the other browsers (apparently, tested only Opera :P) applies a single span over multiple lines, so in order to try to fix this I did:
Code (find) Select
if ($matches[5] === '/')
continue;
else
{

Code (replace with) Select
if ($matches[5] === '/')
continue;
elseif ($matches[2] === 'br')
$replacement .= '<br />';
else
{

Of course I have no idea if this breaks other things...most likely yes...

* emanuele wonders why he didn't track all the WYSIWYG issues so that he could test them for "regressions"... ::)


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Advertisement: