gitmyhub

turpan-remove-space

JavaScript ★ 10 updated 9y ago

remove the space between English word and Chinese characters in markdown files

Turpan-remove-space Explanation

This tool removes spaces between English words and Chinese characters in Markdown files. When you're writing technical documentation, it's often good practice to add a space between English terms (like "JavaScript") and Chinese text for readability. But when your documents go to print or formal publication, those spaces need to come out. This tool automates that cleanup process, converting your Markdown files into formatted HTML files ready for printing.

Here's how it works: you install the tool via npm, point it at a folder containing all your Markdown files, and run a single command. The tool scans through each file, finds spaces between English words and Chinese characters, removes them, and outputs clean HTML files in a new folder alongside your original directory. For example, "学习 JavaScript 语言" (learning JavaScript language, with spaces) becomes "学习JavaScript语言" (no spaces).

By default, the tool removes spaces around any English word next to Chinese characters. But you can also customize it to focus on specific words or phrases if you want more control. Just pass a comma-separated list of target words when you run the command, and it will only strip spaces around those particular terms.

This is useful for anyone publishing Chinese technical documentation—writers, translators, or content teams who need to convert editor-friendly Markdown (with spaces for readability) into publication-ready HTML (with spaces removed for print standards). It saves manual find-and-replace work across many files at once. The tool is simple and straightforward: it takes Markdown in, spits HTML out, with the spacing normalized the way print designers expect.