Support » Plugins » [Plugin: wp-Typography] Bug in dewidow function

  • I have found a bug in dewidow. I noticed that some lines disappear. I have found that commenting line

    $unlockedText = $this->dewidow($unlockedText);

    resolves problem.

    I identified which lines are killed by the function.
    These are utf-8 encoded lines that ends with 2-byte C2 A0 sequence (non-breaking space).

    Eg. <li>some text [C2 A0]</li>
    appears on page as

Viewing 6 replies - 1 through 6 (of 6 total)
  • pik256,

    Thanks for raising this issue. Your solution does not just resolve the problem, it turns off dewidowing entirely. That can also be done in the admin settings (without hacking the code).

    I will see if I can reproduce the bug and fix it in an update.


    Unfortunately, I am unable to reproduce the problem. Could you provide me some sample text; something I can copy and paste into the WordPress editor? Thanks.

    OK. It was not so easy because I used Firefox, but finally I found the way. First, you have to use Internet Explorer. IE visual editor preserves hard spaces. Firefox replaces all hard spaces with soft spaces so even simple edit-save with no change removes all [C2 A0] sequences from text.

    Second, copy text from this page and paste it into WP visual editor (in IE). The first enumerated line ends with hard space [C2 A0]. Dewidowing is turned off. After turning it on, the last fragment of the line (included between </sup> and </li> tags) disappears.


    I am still having difficulty recreating your error.

    I have tried pasting the text provided, and inserting no-break spaces in the form of & nbsp;, & #160;, & #xA0;, and & #x00A0; (with the space trailing the & removed). I did all the editing in WordPress’ HTML editor in IE.

    I then tried to work within Visual Editor, manually typing a no-break space with ctl-shift-space.

    In all instances, everything displayed as expected.

    Well, this must be difference in php configuration, OS, version or something else. In this situation the only way for me is to sit down and debug. I wanted to avoid it because of complexity of regexp and lack of reasonable debug environment. But I will do all my best. Maybe next weekend…


    I just pushed version 1.19, which should resolve your problem.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Plugin: wp-Typography] Bug in dewidow function’ is closed to new replies.