한글 마크다운 작성 시, 특수문자와 인접한 볼드(Bold) 처리가 깨지는 현상을 해결해주는 초경량 라이브러리입니다.
A lightweight utility to fix Markdown rendering issues where Korean text formatting (like Bold) breaks when adjacent to special characters.
표준 마크다운 파서에서는, 한글이 특수문자와 인접해 있을 경우, 볼드(**)와 같은 문법이 렌더링 되지 않는 현상이 발생합니다.
In standard Markdown parsers, Korean characters combined with bold syntax (**) often fail to render correctly if they are immediately preceded by special characters or punctuation without spacing.
Example of the issue:
- As Is: **'중요'**합니다.
- To Be: '중요' 합니다.
이 라이브러리는 정규식을 통해 해당 엣지 케이스에 공백을 추가하여 마크다운 파서가 formatting token을 올바르게 인식하도록 합니다.
This library automatically detects these edge cases using Regex and inserts a space to ensure the Markdown parser recognizes the formatting tokens correctly.
npm install korean-markdown-fixer
# or
pnpm add korean-markdown-fixer
# or
yarn add korean-markdown-fixerimport { fixMarkdown } from "korean-markdown-fixer";
const raw = "이것은 **'중요'**합니다.";
const fixed = fixMarkdown(raw);
console.log(fixed); // space inserted문제가 생기거나, 좋은 아이디어가 있다면 여기서 이 라이브러리에 대한 기여를 해주세요!
If you have any problem or good ideas, please contribute to this library HERE!