markdown-it / markdown-it-cjk-breaks

Suppress linebreaks between east asian characters
https://markdown-it.github.io
MIT License
20 stars 7 forks source link

fix crash due to empty text before a softbreak #5

Open searKing opened 6 months ago

searKing commented 6 months ago

Exception is thrown when a softbreak token is after strong token This script:

var md = require('markdown-it')();
var cjk_breaks = require('markdown-it-cjk-breaks');

md.use(cjk_breaks);

md.render(`
**foo**
bar
`);

Throws an exception:

TypeError: Expected a code point, got `undefined`.

The empty text is generated by markdown-it when a strong token followed by a softbreak token.

image