WordPress.org

Ready to get started?Download WordPress

Forums

WP-Markdown
[resolved] Support for atx-style headers? (4 posts)

  1. mp459
    Member
    Posted 8 months ago #

    Does the wp-markdown plugin support "atx" style headers? e.g.

    # this is an h1

    ## This is an h2

    When I tried it, I got a numbered list instead. No biggie, just curious.
    Y

    http://wordpress.org/plugins/wp-markdown/

  2. mp459
    Member
    Posted 8 months ago #

    I figured this out. SOrry for the confusion. Here are my findings:

    H1 does not work well, but these two formats work:

    #heading1#
    #heading

    The problem is that when editing an existing post, H1 gets translated to # Heading (note the space)—which turns into an ordered list when you save.

    H2 and below seem to work: ## h2 etc.

    So avoid H1, which is a best-practice anyway since it's used for the post title.

  3. Stephen Harris
    Member
    Plugin Author

    Posted 8 months ago #

    Hi,

    H1 works fine for me. #heading1# and #heading1 does get converted to # heading1, but hashtags aren't used for lists in markdown, and so it shouldn't (and doesn't, for me) render as a list.

    Have you got a minimum working example of the bug? I've tested with the following with no issue:

    # Header 1
    
    Pagaraph text
    
    # Header 1
    
    Paragraph text
  4. mp459
    Member
    Posted 8 months ago #

    Hey Stephen Harris

    First, thanks for the reply!

    Second, I've done some testing, and I think this only happens with the P2 theme. This is because P2 does some list formatting, including using # for lists. So even without the wp-markdown plugin, P2's list-creator turns this:

    # one
    # two
    #three

    into:

    1.  one
    2.  two
    3.  three

    With the wp-markdown plugin, this:

    # one
    # two
    # three
    
    #heading 1
    
    ## heading 2

    Turns into this on first save:

    1.  one
    2.  two
    3.  three
    
    # heading 1
    
    ## heading 2

    and on 2nd save:

    1.  one
    2.  two
    3.  three
    
    1.  heading 1
    
    ## heading 2

    I don't think there's much to do with this rather than gape in amazement or disable p2's list-creator.

    Thanks again
    mickey

Reply

You must log in to post.

About this Plugin

About this Topic