News:

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

Main Menu

2.0.2 Break up words longer than setting is ignored

Started by nosx, March 16, 2012, 09:52:34 PM

Previous topic - Next topic

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?


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.

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?

var smf_charset = "ISO-8859-1";

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



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.

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)

// 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']);
}


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.

emanuele

Now maybe I understood what you want: you want to actually see a *space* between the letters. Did I understand correctly?

No, that's not the intended way this function should work in SMF (I'm not saying that you should not use it the way you want, just that the way is working in SMF is the intended one).

I'll wait for you to confirm it or not.

Thanks. ;)


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.

nosx

You can close this as I have managed to do what I needed to do. I thought there was a bug but as I stated it's just the lack of the space between the words that lead me to believe that so as you said it's intended to be that way but for those who want to change the spacing can use the method I described above.

Advertisement: