WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Subscribe2 and Markdown not playing nice (8 posts)

  1. William Jackson
    Member
    Posted 8 years ago #

    I am running the Markdown 1.0.1c and Subscribe2 2.2.4 plugins on WordPress 2.0.4.

    When I installed the Subscribe2 plugin, I created a new page, the only content being the Subscribe2 token (<!--subscribe2-->).

    When the Markdown plugin is active, the Subscribe2 token doesn't expand into the subscription form or messages. When the Markdown plugin is not active, Subscribe2 behaves normally, and the token expands as it should.

    Does anyone know of a workaround so Markdown and Subscribe2 can coexist? Or, is there a way to disable Markdown for just one specific page?

  2. logista
    Member
    Posted 8 years ago #

    There are at least two ways:

    1) I think there's a plugin that lets you choose the text-prettifier you'd like on a per-post basis (but I don't know if it works for pages).

    2) I've been using a kludge to do something similar, with the text-replace plugin, described here.

    Hope this helps!

  3. William Jackson
    Member
    Posted 8 years ago #

    Thank you for those ideas! I think I found the plugin you were thinking of, Markup-Selecter . You can use it on pages as well as posts, but the Subscribe2 token still wasn't expanding as it should.

    I'm still looking into that text-replace solution.

  4. logista
    Member
    Posted 8 years ago #

    (just going back to your original problem)

    When you look at the generated source in your page, does it look like Markdown has intercepted your <!--subscribe2-->? If so, you may want to look at the priority level for each of the plugins.

    (sorry for the disjointed messages -- I'm running on low coffee and bad memory ;))

  5. William Jackson
    Member
    Posted 8 years ago #

    My page content (pre-publish) looks like this:

    Some text.

    <!--subscribe2-->

    Some *more* text.

    The source code looks like this:

    <p>Some text.</p>

    <!--subscribe2-->

    <p>Some <em>more</em> text.</p>

    That's exactly what Markdown should do: leave HTML alone. It's like the Subscribe2 plugin never gets a chance at this text.

    How does one change the priority of plugins?

  6. vkaryl
    Member
    Posted 8 years ago #

    Well, THANK YOU. Never thought about the "Text Control" plugin interfering, and couldn't figure out why the subscribe2 widget refused to show anything but the title in the sidebar!

    Jeez, hope the client can do without Text Control, 'cause he sure can't do without subscribe2....

  7. William Jackson
    Member
    Posted 8 years ago #

    HA! I looked through the code of the Subscribe2 plugin and solved my problem.

    Line 1500 of subscribe2.php contains the regular expression the plugin recognizes as the token to expand. That regex is:

    |<p>(\n)*<!--subscribe2-->(\n)*</p>|

    All I had to do was type <p><!--subscribe2--></p> in my page and it worked, with Markdown active.

    Apparently, Subscribe2 is expecting some text filter to add those <p> tags before it gets a chance to do its thing.

  8. vkaryl
    Member
    Posted 8 years ago #

    Hmmm. Wonder if that will work with the widget too? Guess I'll have to play with it some....

Topic Closed

This topic has been closed to new replies.

About this Topic