Kim Seungmin _
NPM 라이브러리 개발일기
인생 첫 라이브러리 만들기 - 01
인생 첫 라이브러리 만들기 - 01 썸네일

인생 첫 라이브러리 만들기 - 01

2025년 12월 22일 · NPM 라이브러리 개발일기

123.png

AI 쓰면서 열받는 걸 수정해주는 라이브러리를 만들었다.

Korean Markdown Fixer

npm version npm downloads license

한글 마크다운 작성 시, 특수문자와 인접한 볼드(Bold) 처리가 깨지는 현상을 해결해주는 초경량 라이브러리입니다.

A lightweight utility to fix Markdown rendering issues where Korean text formatting (like Bold) breaks when adjacent to special characters.

The Problem

표준 마크다운 파서에서는, 한글이 특수문자와 인접해 있을 경우, 볼드(**)와 같은 문법이 렌더링 되지 않는 현상이 발생합니다.

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: '중요' 합니다.

The Solution

이 라이브러리는 정규식을 통해 해당 엣지 케이스에 공백을 추가하여 마크다운 파서가 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.

Installation

npm install korean-markdown-fixer
# or
pnpm add korean-markdown-fixer
# or
yarn add korean-markdown-fixer

Usage

import { fixMarkdown } from "korean-markdown-fixer";
const raw = "이것은 **'중요'** 합니다.";
const fixed = fixMarkdown(raw);
console.log(fixed); // space inserted

Contribution

문제가 생기거나, 좋은 아이디어가 있다면 여기서 이 라이브러리에 대한 기여를 해주세요!

If you have any problem or good ideas, please contribute to this library HERE!