WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: wp-Typography] Bug in dewidow function (7 posts)

  1. pik256
    Member
    Posted 4 years ago #

    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
    <li></li>
    http://wordpress.org/extend/plugins/wp-typography/

  2. kingjeffrey
    Member
    Posted 4 years ago #

    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.

  3. kingjeffrey
    Member
    Posted 4 years ago #

    pik256,

    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.

  4. pik256
    Member
    Posted 4 years ago #

    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.

  5. kingjeffrey
    Member
    Posted 4 years ago #

    pik256,

    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.

  6. pik256
    Member
    Posted 4 years ago #

    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...

  7. kingjeffrey
    Member
    Posted 4 years ago #

    pik256,

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

Topic Closed

This topic has been closed to new replies.

About this Topic