Browse Source

Fixed regression in 1.2.1 release, closes #88

pull/14/head
Vitaly Puzrin 10 years ago
parent
commit
a9895f72d0
  1. 1
      lib/rules_block/state_block.js
  2. 17
      test/misc.js

1
lib/rules_block/state_block.js

@ -57,6 +57,7 @@ function StateBlock(src, parser, tokens, options, env) {
} }
if (ch === 0x0A || pos === len - 1) { if (ch === 0x0A || pos === len - 1) {
if (ch !== 0x0A) { pos++; }
this.bMarks.push(start); this.bMarks.push(start);
this.eMarks.push(pos); this.eMarks.push(pos);
this.tShift.push(indent); this.tShift.push(indent);

17
test/misc.js

@ -0,0 +1,17 @@
/*global describe, it*/
'use strict';
var assert = require('assert');
var Remarkable = require('../');
describe('Misc', function () {
it('Should correctly parse strings without tailing \\n', function () {
var md = new Remarkable();
assert.strictEqual(md.render('123'), '<p>123</p>\n');
assert.strictEqual(md.render('123\n'), '<p>123</p>\n');
});
});
Loading…
Cancel
Save