{"id":46876099,"url":"https://github.com/xissy/unbroken-markdown","last_synced_at":"2026-03-10T20:56:15.754Z","repository":{"id":311134417,"uuid":"1042591182","full_name":"xissy/unbroken-markdown","owner":"xissy","description":null,"archived":false,"fork":false,"pushed_at":"2025-08-29T23:34:27.000Z","size":45,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-30T01:19:04.789Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xissy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-08-22T08:59:15.000Z","updated_at":"2025-08-29T23:34:29.000Z","dependencies_parsed_at":"2025-08-22T11:28:05.702Z","dependency_job_id":null,"html_url":"https://github.com/xissy/unbroken-markdown","commit_stats":null,"previous_names":["xissy/unbroken-markdown"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/xissy/unbroken-markdown","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xissy%2Funbroken-markdown","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xissy%2Funbroken-markdown/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xissy%2Funbroken-markdown/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xissy%2Funbroken-markdown/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xissy","download_url":"https://codeload.github.com/xissy/unbroken-markdown/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xissy%2Funbroken-markdown/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30355219,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T15:55:29.454Z","status":"ssl_error","status_checked_at":"2026-03-10T15:54:58.440Z","response_time":106,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-03-10T20:56:11.165Z","updated_at":"2026-03-10T20:56:15.707Z","avatar_url":"https://github.com/xissy.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# unbroken-markdown\n\nFix broken markdown during streaming to ensure proper rendering. This package intelligently moves punctuation marks outside of bold/italic markers and handles incomplete markdown patterns during streaming.\n\n## What it does\n\nWhen markdown is streamed or improperly formatted, you might see broken rendering like:\n\n- `**\"text\"**` → `\"**text**\"` (quotes outside bold)\n- `*text(info)*` → `*text*(info)` (parentheses outside italic)\n- `**50%**` → `**50**%` (percentage outside bold)\n- `**\u003ctext\u003e**` → `\u003c**text**\u003e` (angle brackets outside bold)\n- `**『책 제목』**` → `『**책 제목**』` (Korean quotation marks)\n- Incomplete image markdown removal during streaming\n\n## Installation\n\n```bash\nnpm install unbroken-markdown\n# or\nyarn add unbroken-markdown\n# or\nbun add unbroken-markdown\n```\n\n## Usage\n\n```typescript\nimport { unbreak } from 'unbroken-markdown';\n\nconst input = '**\"Hello (world)\"**';\nconst output = unbreak(input);\nconsole.log(output); // \"**Hello** (world)\"\n\n// Works with italic too\nconst italicInput = '*text(info)*';\nconst italicOutput = unbreak(italicInput);\nconsole.log(italicOutput); // *text*(info)\n```\n\n## Features\n\n### Bold Pattern Fixes\n\n- Quotes: `**\"text\"**` → `\"**text**\"`\n- Parentheses: `**text(info)**` → `**text**(info)`\n- Percentages: `**50%**` → `**50**%`\n- Links: `**[text](url)**` → `[**text**](url)`\n- Angle brackets: `**\u003ctext\u003e**` → `\u003c**text**\u003e`\n- Korean brackets: `**『text』**` → `『**text**』`, `**「text」**` → `「**text**」`, `**《text》**` → `《**text**》`, `**〈text〉**` → `〈**text**〉`\n\n### Italic Pattern Fixes\n\n- Quotes: `*\"text\"*` → `\"*text*\"`\n- Parentheses: `*text(info)*` → `*text*(info)`\n- Percentages: `*50%*` → `*50*%`\n- Links: `*[text](url)*` → `[*text*](url)`\n- Angle brackets: `*\u003ctext\u003e*` → `\u003c*text*\u003e`\n- Korean brackets: `*『text』*` → `『*text*』`, `*「text」*` → `「*text*」`, `*《text》*` → `《*text*》`, `*〈text〉*` → `〈*text*〉`\n\n### Streaming Support\n\n- Removes incomplete image markdown patterns\n- Handles partial markdown during real-time streaming\n- Ensures consistent rendering even with interrupted markdown\n\n## API\n\n### `unbreak(markdown: string): string`\n\nThe main function that processes and fixes broken markdown text.\n\n**Parameters:**\n\n- `markdown` - The markdown string to process\n\n**Returns:**\n\n- Unbroken and properly formatted markdown string\n\n## Examples\n\n### Complex nested patterns\n\n```typescript\nconst input = '**AI \"innovative (breakthrough)\" technology**';\nconst output = unbreak(input);\n// Output: AI \"**innovative** (breakthrough)\" technology\n```\n\n### Mixed bold and italic\n\n```typescript\nconst input = '**Bold (text)** and *Italic (text)*';\nconst output = unbreak(input);\n// Output: **Bold** (text) and *Italic* (text)\n```\n\n### Text with quotes\n\n```typescript\nconst input = \"**'Church of Light'** mentioned\";\nconst output = unbreak(input);\n// Output: '**Church of Light**' mentioned\n```\n\n### Korean quotation marks\n\n```typescript\nconst input = '**『책의 제목』**을 표기할 때 사용해요.';\nconst output = unbreak(input);\n// Output: 『**책의 제목**』을 표기할 때 사용해요.\n```\n\n## Use Cases\n\nPerfect for:\n\n- Real-time markdown streaming applications\n- Chat applications with markdown support\n- Content management systems\n- Markdown editors with live preview\n- AI-generated content processing\n\n## License\n\nMIT\n\n## Contributing\n\nIssues and pull requests are welcome at [GitHub repository](https://github.com/xissy/unbroken-markdown).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxissy%2Funbroken-markdown","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxissy%2Funbroken-markdown","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxissy%2Funbroken-markdown/lists"}