@ -124,7 +124,7 @@ ParserBlock.prototype.parse = function (src, md, env, outTokens) {
src = src.replace(NEWLINES_RE, '\n');
// Strin NULL characters
src = src.replace(NULL_RE, '');
src = src.replace(NULL_RE, '\uFFFD');
// Replace tabs with proper number of spaces (1..4)
if (src.indexOf('\t') >= 0) {
@ -167,7 +167,7 @@ describe('Misc', function () {
it('Should strip (or replace) NULL characters', function () {
var md = markdownit();
assert.strictEqual(md.render('foo\u0000bar'), '<p>foobar</p>\n');
assert.strictEqual(md.render('foo\u0000bar'), '<p>foo\uFFFDbar</p>\n');
});
it('Should correctly parse strings without tailing \\n', function () {