Code fragment like to markup language in code block modifed when saved #23

Closed
reshout opened this Issue Jun 26, 2013 · 5 comments

Comments

Projects
None yet
2 participants

reshout commented Jun 26, 2013

 server.send({
    text: text,
    from: "xxx <xxx@gmail.com>",
    to: "xxx <xxx@gmail.com>",
    subject: "xxx"
  }, function(err, message) {
    console.log(err || message);
  });

WP-MarkDown modify this code as follows:

 server.send({
    text: text,
    from: "xxx <xxx @gmail.com>",
    to: "xxx </xxx><xxx @gmail.com>",
    subject: "xxx"
  }, function(err, message) {
    console.log(err || message);
  });</xxx>
Owner

stephenharris commented Jun 26, 2013

Can't reproduce this but looks like its trying to 'balance tags'.

On a related note I've noticed that the "tags" <xxx> are removed if you're a non-admin. This is because post content sanitisation (including stripping of disallowed tags) occurs before content is converted to HTML.

Similarly balanceTags() is also used before the content is converted to HTML - which would explain the above bug - but I'm not why I'm unable to reproduce it.

Are you posting the above as admin/author?

reshout commented Jun 26, 2013

Yes, I posted the following article as an administrator.

http://www.reshout.com/?p=385

Instead of being removed, closing tags </reshout> are appended.

Is it possible to avoid applying balncedTags() on the text in a code block?

Owner

stephenharris commented Jun 26, 2013

Something similar to the fix for non-admins above should work for the balanceTags() issue. I'll push an update here later today - if you could test it out that would be grand :).

reshout commented Jun 27, 2013

After applying 2debb2b, the problem is resolved. Thanks for quick response.

reshout closed this Jun 27, 2013

Owner

stephenharris commented Jun 27, 2013

Awesome, no problem :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment