Menu

#23 Spaces around asterisks should be taken care of

v1.0 (example)
open
nobody
None
5
2013-08-15
2013-08-15
Arnoques
No

When an "*" is surrounded by spaces, it is treated as a literal asterisk. This is not taken into account by markdownify.

Example:

This is <b>bold</b> text.<br />
This is <b>wrong </b>text.<br />
This is<b> wrong</b> text.`

Output:

This is **bold** text.  
This is **wrong **text.  
This is** wrong** text.

Passing that to markdown I get:

<p>This is <strong>bold</strong> text. <br />
This is <strong>wrong <em>*text. <br />
This is</strong> wrong</em>* text.</p>

The correct output should be:

This is **bold** text.  
This is **wrong** text.  
This is **wrong** text.

Interestingly, this bug tracker renders "this is **wrong **text" as "this is wrong text".

I attached a patch that corrects that. It's very much a hack, and I only tested it in a few test cases, but it might be useful.

1 Attachments

Discussion


Log in to post a comment.