package
Suppress linebreaks between east asian characters
npm install markdown-it-cjk-breaksGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
Plugin for markdown-it that suppresses linebreaks between east asian characters.
Normally newlines in a markdown text get rendered as newlines in output html text. Then browsers will usually render those newlines as whitespace (more smart behavior is included in w3c drafts, but not actually implemented by vendors).
This plugin finds and removes newlines that cannot be converted to space, algorithm matches CSS Text Module Level 3:
yarn add markdown-it-cjk-breaksvar md = require('markdown-it')();
var cjk_breaks = require('markdown-it-cjk-breaks');
md.use(cjk_breaks);
md.render(`
あおえ
うい
aoe
ui
`);
// returns:
//
//<p>あおえうい
//aoe
//ui</p>Estimated unpacked size across 2 packages.
46.7 kB
Includes dependencies.