Skip to content

sngminn/korean-markdown-fixer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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!

About

한국어 마크다운 깨짐 교정 라이브러리

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published