Skip to content

A remark plugin to remove extra space between CJK Characters.

License

Notifications You must be signed in to change notification settings

purefun/remark-join-cjk-lines

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

remark-join-cjk-lines

Node.js CI Node.js Package

remark-join-cjk-lines is a remark plugin to remove extra space between CJK Characters.

Installation

npm install remark-join-cjk-lines
# or
yarn add remark-join-cjk-lines

Usage

With Remark directly

const remark = require('remark');
const joinCJKLines = require('remark-join-cjk-lines');
remark()
  .use(joinCJKLines)
  .processSync(/*...*/);

With Gatsby

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: [],
     },
  },
],

With Docusaurus v2

// 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.

License

MIT licensed