Code fragment like to markup language in code block modifed when saved
Closed this issue · 5 comments
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>
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?
Yes, I posted the following article as an administrator.
Instead of being removed, closing tags </reshout>
are appended.
Is it possible to avoid applying balncedTags()
on the text in a code block?
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 :).
Awesome, no problem :)