Skip to content

Commit c23c5e6

Browse files
committed
docs: escape jsx-like tags
1 parent d96e116 commit c23c5e6

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

docs/components/ChangelogContent.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ Released packages:
274274

275275
---
276276

277-
fix(plugin-basic-ui): add `maxWidth` option in <Modal /> [`eb4578f`](https://github.com/daangn/stackflow/commit/eb4578f)
277+
fix(plugin-basic-ui): add `maxWidth` option in `<Modal />` [`eb4578f`](https://github.com/daangn/stackflow/commit/eb4578f)
278278

279279
Released packages:
280280
- 📦 [@stackflow/[email protected]](https://npmjs.com/package/@stackflow/plugin-basic-ui/v/1.10.1)

docs/scripts/generate-changelog.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,18 @@ async function organizeChangelogEntries(
267267
return entries;
268268
}
269269

270+
/**
271+
* JSX처럼 보이는 텍스트를 백틱 코드로 감싸서 MDX 파싱 오류 방지
272+
* 예: <Modal /> → `<Modal />`
273+
*/
274+
function escapeJsxLikeTags(text: string): string {
275+
// 이미 백틱으로 감싸진 경우는 제외하고, <ComponentName /> 또는 <ComponentName> 패턴을 찾아서 변환
276+
return text.replace(
277+
/(?<!`)(<[A-Z][a-zA-Z]*(?:\s+[^>]*)?\s*\/?>)(?!`)/g,
278+
"`$1`",
279+
);
280+
}
281+
270282
/**
271283
* changelog 마크다운 생성 (frontmatter 없이 컨텐츠만)
272284
*/
@@ -310,7 +322,7 @@ function generateChangelogMarkdown(
310322
changesetContent += `\n${restLines.join("\n")}`;
311323
}
312324

313-
markdown += `${changesetContent}\n`;
325+
markdown += `${escapeJsxLikeTags(changesetContent)}\n`;
314326

315327
// "영향받는 패키지"를 bullet point로 추가
316328
if (changeset.packages.length > 0) {

0 commit comments

Comments
 (0)