WordPress.org

Forums

[Plugin: Democracy] "n" being inserted in posts in WordPress 2.6 (8 posts)

  1. natbaker
    Member
    Posted 6 years ago #

    When I use the {democracy:id} tag in the post it automatically inserts a lower case "n" in the published post right before the poll. Very annoying and i can't figure out how to get rid of it. What's worse is each time you go in to edit the post it adds another "n"!

  2. jtfisher
    Member
    Posted 6 years ago #

    I'm getting this too. Any responses?

  3. LydiaLeibs
    Member
    Posted 6 years ago #

    i'm also getting this. arghh!!! i suspect it may be fixed in the latest version, but it requires upgrading to wordpress 2.7, and i'm not ready to do that yet. any other ideas?

  4. summerhogan
    Member
    Posted 6 years ago #

    I'm using WP 2.7 and I'm getting the "n" too. I'm using Democracy in WP 2.3.2 and there are no problems, so it must be something non-compatible with newer versions of WP.

  5. glrss
    Member
    Posted 6 years ago #

    To remove the stray 'n' I've found that line 331 of democracy.php needs altering from

    return preg_replace('/{democracy[\w\W\s^}]*?}/', '\n<div>\</div>', $content);

    to

    return preg_replace('/{democracy[\w\W\s^}]*?}/', '<div>\</div>', $content);

  6. drekyn
    Member
    Posted 6 years ago #

    on line 331 you have to replace the ' with the 2 this way:

    return preg_replace('/{democracy[\w\W\s^}]*?}/', '\n<div>\</div>', $content);

    to

    return preg_replace('/{democracy[\w\W\s^}]*?}/', "\n<div>\</div>", $content);

    this fix worked for me

  7. Mariokluser
    Member
    Posted 6 years ago #

    Yes this fix works!

  8. blogwriter
    Member
    Posted 5 years ago #

    RE: Democracy Poll 2.0.1

    removing 'n on line 331 doesn't work for WordPress v. 2.8.1 (n still shows up)

    and replacing '\n with "\n doesn't work for WP v. 2.8.1 (gives fatal error)

    the democracy *widget* works fine on WP v. 2.8.1

    Has anyone come up with a workaround for removing the n in democracy poll 2.0.1 when using WP v. 2.8.1?

    Thank you!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags