remark-join-cjk-lines
is a remark plugin
to remove extra space between CJK Characters.
npm install remark-join-cjk-lines
# or
yarn add remark-join-cjk-lines
const remark = require('remark');
const joinCJKLines = require('remark-join-cjk-lines');
remark()
.use(joinCJKLines)
.processSync(/*...*/);
With gatsby-transformer-remark
:
// gatsby-config.js
plugins: [
{
resolve: `gatsby-transformer-remark`,
options: {
plugins: [require('remark-join-cjk-lines')],
},
},
],
With gatsby-plugin-mdx
:
// gatsby-config.js
plugins: [
{
resolve: 'gatsby-plugin-mdx',
options: {
extensions: ['.md', '.mdx'],
remarkPlugins: [require('remark-join-cjk-lines')],
gatsbyRemarkPlugins: [],
},
},
],
// docusaurus.config.js
module.exports = {
// ...
presets: [
[
'@docusaurus/preset-classic',
{
docs: {
remarkPlugins: [require('remark-join-cjk-lines')],
},
},
],
],
};
Docusaurus's remarkPlugins take effect in build mode only.
NOTE: Run
gatsby clean
to take effect.