SMF Development > Fixed or Bogus Bugs

2.0.2 Break up words longer than setting is ignored

(1/2) > >>

nosx:
As the tittle says the setting for breaking up words longer then X characters is ignored even tho the popup window in the ACP says that it WILL work on my server.

Test: longgggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggwooooooooooooooooooooooorrrrrrrrrrrdddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd

SMF Version 2.0.2
Theme: Default

P.S.

Looks like it's broken on this site as well unless you have it set to a much higher number then the default of 40 or have it turned off on these forums.

emanuele:
Works fine in my test forum.

Here doesn't work most likely because the forum is UTF8 and as written in the popup the option doesn't work in that case. ;)
What charset are you using? UTF8 by chance?

nosx:

--- Quote from: emanuele on March 17, 2012, 05:41:58 AM ---Works fine in my test forum.

Here doesn't work most likely because the forum is UTF8 and as written in the popup the option doesn't work in that case. ;)
What charset are you using? UTF8 by chance?

--- End quote ---


--- Code: ---var smf_charset = "ISO-8859-1";
--- End code ---

Not UTF-8

The odd part is that if I copy and paste a word that is over the character limit then the word gets broken up like it should, but any text that is directly typed into the textarea is not broken up, so can anyone explain that ?

emanuele:
WYSIWYG editor?

nosx:
WYSIWYG editor is turned off for all users so it's not that either.

Update:
I just installed a fresh 2.0.2 forum without any mods or custom themes and have made sure the charset was not utf-8 and on the default (curve) theme the char limit setting was again ignored.

Interesting Findings:
 - If you copy and paste text into the text area then the words get broken up as expected.
- Copying and pasting text from within the editor itself does NOT work.
- If you toggle between the richeditor and normal editor the words get broken up as expected.

The CORE theme does not exhibit this behavior and works like expected so there is definitely something wrong with the default theme that needs to be looked into.

Update#2

After much experimentation I have discovered the text DOES break up, but the styles that are applied make it appear like the words are not broken up. (See the code block below)
 
Subs.php (Lines 1705-1719)

--- Code: --- // This saves time by doing our break long words checks here.
if (!empty($modSettings['fixLongWords']) && $modSettings['fixLongWords'] > 5)
{
if ($context['browser']['is_gecko'] || $context['browser']['is_konqueror'])
$breaker = '<span style="margin: 0 -0.5ex 0 0;"> </span>';
// Opera...
elseif ($context['browser']['is_opera'])
$breaker = '<span style="margin: 0 -0.65ex 0 -1px;"> </span>';
// Internet Explorer...
else
$breaker = '<span style="width: 0; margin: 0 -0.6ex 0 -1px;"> </span>';

// PCRE will not be happy if we don't give it a short.
$modSettings['fixLongWords'] = (int) min(65535, $modSettings['fixLongWords']);
}
--- End code ---

My solution is to use adjust values for the margins until you are satisfied with the results and you can actually SEE the words are indeed breaking up as expected.

Navigation

[0] Message Index

[#] Next page

Go to full version