stephenharris / WP-MarkDown

WP-MarkDown plug-in. Allows Markdown to be enabled in posts, comments and bbPress forums.
http://wordpress.org/extend/plugins/wp-markdown/
112 stars 19 forks source link

Pipe character added after dashes #14

Closed BrenBarn closed 11 years ago

BrenBarn commented 11 years ago

Entering three hyphens in running text (---), then saving and reloading, causes WP-Markdown to reparse the --- as \---|. The pipe character | is added for some reason. When this is saved, the pipe is saved too, so a literal pipe appears in the post text. When the post is reloaded again, another pipe is added, so it becomes \---||, and so on, so every time you save and reload, more pipes appear in the post.

stephenharris commented 11 years ago

I believe this is because that is the syntax for tables (http://michelf.ca/projects/php-markdown/extra/#table). What is the purpose of the three dashes? If you want to use an em dash, you could use either the character itself or —.

BrenBarn commented 11 years ago

According to that page, the table markdown requires the hyphens separating header and content to be on a line by themselves. Hyphens in the middle of a line shouldn't be interpreted as part of a table.

I'm used to LaTeX, in which three hyphens is an em dash and two is an en dash. There's no easy way to type an actual emdash character. I could of course type —, but the whole point of markdown is to provide simpler ways to write things. If this lib doesn't support the triple-hyphen, that's fine, but it shouldn't then go adding pipes to it.

stephenharris commented 11 years ago

I'm aware of that. My suggestion was that this was perhaps confusing the MarkDown extra class. On closer inspection, the fault lies in Markdownify incorrectly parsing the mdash.