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

exception rendering `**a**\nb` #6

Open tylerlong opened 1 week ago

tylerlong commented 1 week ago
import markdownit from 'markdown-it';
import cjkBreaksExt from 'markdown-it-cjk-breaks';

let md = markdownit({
  html: true,
});
md = md.use(cjkBreaksExt);

md.render('**a**\nb');
TypeError: Expected a code point, got `undefined`.
 ❯ validate node_modules/get-east-asian-width/index.js:5:9
 ❯ eastAsianWidthType node_modules/get-east-asian-width/index.js:10:2
 ❯ process_inlines node_modules/markdown-it-cjk-breaks/index.mjs:49:24
 ❯ Array.cjk_breaks node_modules/markdown-it-cjk-breaks/index.mjs:65:5
 ❯ Core.process node_modules/markdown-it/lib/parser_core.mjs:56:13
 ❯ MarkdownIt.parse node_modules/markdown-it/lib/index.mjs:511:13
 ❯ MarkdownIt.render node_modules/markdown-it/lib/index.mjs:530:36
tylerlong commented 1 week ago

Covered by https://github.com/markdown-it/markdown-it-cjk-breaks/pull/5