Skip to content

Conversation

@searKing
Copy link

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

@KSR-Yasuda
Copy link

Any update for this?
It is a considerable bug that crashes this lib.
Could you merge the fix to the latest release if no reason to hesitate, please? > repo owner, @puzrin or @rlidwka ?

@yamavol
Copy link

yamavol commented Oct 11, 2025

I'm also the one waiting to this issue to be fixed and merged.

@searKing
I think you should use continue instead of break.
This plugin still needs to remove the softbreak between CJK letters.

**山**
田

should be rendered as

<p><strong>山</strong>田</p>

but your change won't do this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants