Skip to content

Commit

Permalink
feat(writer-markdown): omit escape
Browse files Browse the repository at this point in the history
  • Loading branch information
metonym committed Nov 12, 2024
1 parent 2497b1a commit 951a5fa
Show file tree
Hide file tree
Showing 2 changed files with 134 additions and 131 deletions.
5 changes: 4 additions & 1 deletion src/writer/writer-markdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ function formatPropType(type?: any) {
}

function escapeHtml(text: string) {
return text.replace(/\</g, "&lt;").replace(/\>/g, "&gt;");
// Find any HTML-like tags and wrap them in code tags
return text.replace(/(<[^>]+>)/g, (match) => {
return `<code>${match.replace(/\</g, "&lt;").replace(/\>/g, "&gt;")}</code>`;
});
}

function formatPropValue(value: any) {
Expand Down
Loading

0 comments on commit 951a5fa

Please sign in to comment.