Skip to content

Unmatched tag irreversably destroys markdown #47

@drewcrawford

Description

@drewcrawford

I was working on a post earlier this evening and somehow (it is a mystery to me how exactly) I got an errant <p> tag in my div. What happened next was unexpected:

  1. WP-Markdown preprocessed all the text following the errant tag, converting MD to HTML markup
  2. This conversion occurred silently. I was still happily working in Markdown, completely unaware that WP-markdown had bricked a long part of the article behind the scenes in a way that didn't immediately show up while I was typing
  3. The error finally showed up when I hit "Save Draft" but that triggers a page refresh and so I no longer have a buffer with the original Markdown text
  4. Between steps 2 and 3, I piled up over an hour's worth of revision history that all contained HTML markup instead of MD markup
  5. Thus there is no way to restore to any backup that contains MD markup without losing an hour's work.

Reproduction steps

Paste this into a post

<div id="for_ios">
  Whatever some text <p>
</div>

Test 

1

2

3

Press "Save Draft"

Expected results: same as input

Actual results:

<div id="for_ios">
  Whatever some text <p>
    </div> <p>
      Test
    </p>

    <p>
      1
    </p>

    <p>
      2
    </p>

    <p>
      3
    </p>

Expected result: some kind of clue that I am saving non-markdown markup to the DB

Actual result: no clue that I am destroying the sole copy of my Markdown source by pressing "Save Draft"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions