{"_id":"@coreator/remark-wysiwyg-breaks","_rev":"6-1dc01adbd452319598f523330d48accf","name":"@coreator/remark-wysiwyg-breaks","dist-tags":{"latest":"1.0.5"},"versions":{"1.0.0":{"name":"@coreator/remark-wysiwyg-breaks","version":"1.0.0","keywords":["remark","remark-plugin","markdown","wysiwyg","line-break","hard-break","preserve-breaks"],"author":"","license":"MIT","_id":"@coreator/remark-wysiwyg-breaks@1.0.0","maintainers":[{"name":"coreator","email":"coreator.net@gmail.com"}],"dist":{"shasum":"8b3e1233200e0a71343f033d39dcef7e62ab4f19","tarball":"https://registry.npmjs.org/@coreator/remark-wysiwyg-breaks/-/remark-wysiwyg-breaks-1.0.0.tgz","fileCount":8,"integrity":"sha512-/ekW2fFqpekAIBIxUwyXASt+y9MqUD0FACWr4P8/DFNH3zY3+lr2mzxR0uuDU+1xqbIgxfPWec1WSeyK8mi2WA==","signatures":[{"sig":"MEQCH1JHz2/s2J9ZVPqhitMj/9BZiGMPLHpGz1I9xuAwpqgCIQDa5GJtLKCvJf8bHEKJlI0YVjm10WNxyANCLUxfk9f34w==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":24372},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"gitHead":"287e8995e1a4332de06bdbc4b024c304f03c09a9","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","test:watch":"vitest","prepublishOnly":"npm run build"},"_npmUser":{"name":"coreator","email":"coreator.net@gmail.com"},"repository":{"url":"","type":"git"},"_npmVersion":"10.8.1","description":"A remark plugin that preserves line breaks and empty lines as users intended (WYSIWYG)","directories":{},"_nodeVersion":"22.13.0","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.0","vitest":"^1.0.0","unified":"^11.0.0","typescript":"^5.0.0","@types/node":"^20.0.0"},"peerDependencies":{"unified":">=10.0.0"},"_npmOperationalInternal":{"tmp":"tmp/remark-wysiwyg-breaks_1.0.0_1770781537042_0.8723370564358262","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@coreator/remark-wysiwyg-breaks","version":"1.0.1","keywords":["remark","remark-plugin","markdown","wysiwyg","line-break","hard-break","preserve-breaks"],"author":"","license":"MIT","_id":"@coreator/remark-wysiwyg-breaks@1.0.1","maintainers":[{"name":"coreator","email":"coreator.net@gmail.com"}],"dist":{"shasum":"fb2b572e07c437ea80659f82a935695e574d4302","tarball":"https://registry.npmjs.org/@coreator/remark-wysiwyg-breaks/-/remark-wysiwyg-breaks-1.0.1.tgz","fileCount":8,"integrity":"sha512-6XD39VE4jLV8pT+3L3BpgjuNihHcNECainkvFCRA/TCoLMVd6a3DJQJeBFd/PbZZfh7UY/uP7ldoifcsycPKbQ==","signatures":[{"sig":"MEQCIFOY6IC03AUCP8RedT7ODfjX2Q/Or5yXVDGUcNzr+40YAiAZtZ7iPAII/9VJDWUARoCGpgNmoqPKvnaz4E9j9XZLZA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":25892},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"gitHead":"287e8995e1a4332de06bdbc4b024c304f03c09a9","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","test:watch":"vitest","prepublishOnly":"npm run build"},"_npmUser":{"name":"coreator","email":"coreator.net@gmail.com"},"repository":{"url":"","type":"git"},"_npmVersion":"10.8.1","description":"A remark plugin that preserves line breaks and empty lines as users intended (WYSIWYG)","directories":{},"_nodeVersion":"22.13.0","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.0","vitest":"^1.0.0","unified":"^11.0.0","typescript":"^5.0.0","@types/node":"^20.0.0"},"peerDependencies":{"unified":">=10.0.0"},"_npmOperationalInternal":{"tmp":"tmp/remark-wysiwyg-breaks_1.0.1_1775699186939_0.7772238562240883","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@coreator/remark-wysiwyg-breaks","version":"1.0.2","keywords":["remark","remark-plugin","markdown","wysiwyg","line-break","hard-break","preserve-breaks"],"author":"","license":"MIT","_id":"@coreator/remark-wysiwyg-breaks@1.0.2","maintainers":[{"name":"coreator","email":"coreator.net@gmail.com"}],"dist":{"shasum":"62e778c85ada6f27a5d9a6c6fa7b5e7ea3f3f205","tarball":"https://registry.npmjs.org/@coreator/remark-wysiwyg-breaks/-/remark-wysiwyg-breaks-1.0.2.tgz","fileCount":8,"integrity":"sha512-3BtJuJbi+4qa/6NH7FeXz3olfnU5do7busxYJvgdZfARcdVUEyX06aCE+FSOYiphJJTZP5zvXL3qkLobKKQZmQ==","signatures":[{"sig":"MEYCIQCe1ZBrpzsFww4CVyaSvRQ0uL0npw193kXz+k3VYAWjcQIhAKcDLW2oqj3CSnUqDBjQddakYsPD19SkA2IG84e4wlkQ","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":28383},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"gitHead":"8281259e8153c4e38babb42500272b7cc5753d2b","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","test:watch":"vitest","prepublishOnly":"npm run build"},"_npmUser":{"name":"coreator","email":"coreator.net@gmail.com"},"repository":{"url":"","type":"git"},"_npmVersion":"10.8.1","description":"A remark plugin that preserves line breaks and empty lines as users intended (WYSIWYG)","directories":{},"_nodeVersion":"22.13.0","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.0","vitest":"^1.0.0","unified":"^11.0.0","typescript":"^5.0.0","@types/node":"^20.0.0"},"peerDependencies":{"unified":">=10.0.0"},"_npmOperationalInternal":{"tmp":"tmp/remark-wysiwyg-breaks_1.0.2_1776389006428_0.7533674725271011","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@coreator/remark-wysiwyg-breaks","version":"1.0.3","keywords":["remark","remark-plugin","markdown","wysiwyg","line-break","hard-break","preserve-breaks"],"author":"","license":"MIT","_id":"@coreator/remark-wysiwyg-breaks@1.0.3","maintainers":[{"name":"coreator","email":"coreator.net@gmail.com"}],"dist":{"shasum":"d48fb3299b10aa282fc1d0e6523f42dd07f5a3cf","tarball":"https://registry.npmjs.org/@coreator/remark-wysiwyg-breaks/-/remark-wysiwyg-breaks-1.0.3.tgz","fileCount":8,"integrity":"sha512-RFOEhrm3dnEuQgrHKx5HWMgMxsFfMUhxNyvsUovxttSf62Ka78WSJcoy5Y/HEcsE+Q8aP0cJEOYJ3EukDvy+jQ==","signatures":[{"sig":"MEUCIQDWswYYOmnTcZe4Y97cmpwzyaGyS0l0Mjnxy0fz99AjtgIgRWWHBHGVlIYnFcZ/OrVuNwxxOIRkCKs54Eu+tXW0TuU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":29806},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"gitHead":"25f6808b18b4ab7ec005d2e947ca930bcf9604d8","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","test:watch":"vitest","prepublishOnly":"npm run build"},"_npmUser":{"name":"coreator","email":"coreator.net@gmail.com"},"repository":{"url":"","type":"git"},"_npmVersion":"10.8.1","description":"A remark plugin that preserves line breaks and empty lines as users intended (WYSIWYG)","directories":{},"_nodeVersion":"22.13.0","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.0","vitest":"^1.0.0","unified":"^11.0.0","typescript":"^5.0.0","@types/node":"^20.0.0"},"peerDependencies":{"unified":">=10.0.0"},"_npmOperationalInternal":{"tmp":"tmp/remark-wysiwyg-breaks_1.0.3_1776390119676_0.7834319511858052","host":"s3://npm-registry-packages-npm-production"}},"1.0.4":{"name":"@coreator/remark-wysiwyg-breaks","version":"1.0.4","keywords":["remark","remark-plugin","markdown","wysiwyg","line-break","hard-break","preserve-breaks"],"author":"","license":"MIT","_id":"@coreator/remark-wysiwyg-breaks@1.0.4","maintainers":[{"name":"coreator","email":"coreator.net@gmail.com"}],"dist":{"shasum":"8975a028000e2933805d4cb8b3b3ec5a3fe85e41","tarball":"https://registry.npmjs.org/@coreator/remark-wysiwyg-breaks/-/remark-wysiwyg-breaks-1.0.4.tgz","fileCount":8,"integrity":"sha512-fN3DVq9WBPHbVi4DV7YTX/ukpQAyMn0LuYUfmlnR+EeEO8AGFxiKSSGbVZRrDeLFU1gSKodvwnZO/6Ndl5wO/w==","signatures":[{"sig":"MEQCIEW74e74BAZWd5f44cW7IHiSnUO1SPdlZje5zT81akD4AiBLlsom9lxpVNvRG2aSPfeuDgIkOJNiMBTlkj3FCYpSvw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":44229},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"gitHead":"7dd1849596c6131855a53d297cd3f2f3ab1ceeba","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","test:watch":"vitest","prepublishOnly":"npm run build"},"_npmUser":{"name":"coreator","email":"coreator.net@gmail.com"},"repository":{"url":"","type":"git"},"_npmVersion":"10.8.1","description":"A remark plugin that preserves line breaks and empty lines as users intended (WYSIWYG)","directories":{},"_nodeVersion":"22.13.0","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.0","vitest":"^1.0.0","unified":"^11.0.0","typescript":"^5.0.0","@types/node":"^20.0.0"},"peerDependencies":{"unified":">=10.0.0"},"_npmOperationalInternal":{"tmp":"tmp/remark-wysiwyg-breaks_1.0.4_1776405491190_0.8251061410592617","host":"s3://npm-registry-packages-npm-production"}},"1.0.5":{"_id":"@coreator/remark-wysiwyg-breaks@1.0.5","dist":{"shasum":"feb2f6b9391bd76df0a1197762cc4cdf57d9c76f","tarball":"https://registry.npmjs.org/@coreator/remark-wysiwyg-breaks/-/remark-wysiwyg-breaks-1.0.5.tgz","fileCount":8,"integrity":"sha512-VDKK+PzyrCpZ600nMjvAfb6s1eSxtZKTByrp0oh7QgVHM3ldhEqNjX3Bi3nK+3N6GP6a5NtyQjIom09x/kKE7w==","signatures":[{"sig":"MEUCIQDK3Vt7h8CNCKOAEju8WtMW72MAjVn53DDownk68qJCggIgLU8d5vmARoSrj41dNvyXxS92r8YfUerlCX52oswKklo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCLY9ag7S5ksJv6tZjXjbPnbIQ5meZknQ76QIjFbRoX5wIhAJv8pjrtyUPsYnrw3Ee06k9JqNJfMltOWyfT1btI7ZfL"}],"unpackedSize":51899},"main":"./dist/index.cjs","name":"@coreator/remark-wysiwyg-breaks","type":"module","types":"./dist/index.d.ts","author":"","module":"./dist/index.js","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"gitHead":"7ee1b7d3da8ae72240f7030d6a9933c53ac4e79f","license":"MIT","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","test:watch":"vitest","prepublishOnly":"npm run build"},"version":"1.0.5","_npmUser":{"name":"coreator","email":"coreator.net@gmail.com"},"keywords":["remark","remark-plugin","markdown","wysiwyg","line-break","hard-break","preserve-breaks"],"repository":{"url":"","type":"git"},"_npmVersion":"10.8.1","description":"A remark plugin that preserves line breaks and empty lines as users intended (WYSIWYG)","directories":{},"maintainers":[{"name":"coreator","email":"coreator.net@gmail.com"}],"_nodeVersion":"22.13.0","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.0","vitest":"^1.0.0","unified":"^11.0.0","rehype-raw":"^7.0.0","remark-gfm":"^4.0.1","typescript":"^5.0.0","@types/node":"^20.0.0","remark-parse":"^11.0.0","remark-rehype":"^11.1.2","rehype-stringify":"^10.0.1","remark-directive":"^4.0.0","remark-frontmatter":"^5.0.0"},"peerDependencies":{"unified":">=10.0.0"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/remark-wysiwyg-breaks_1.0.5_1791031296944_0.2429919636621447"}}},"time":{"created":"2026-02-11T03:45:36.973Z","modified":"2026-10-03T12:41:37.209Z","1.0.0":"2026-02-11T03:45:37.215Z","1.0.1":"2026-04-09T01:46:27.154Z","1.0.2":"2026-04-17T01:23:26.567Z","1.0.3":"2026-04-17T01:41:59.891Z","1.0.4":"2026-04-17T05:58:11.321Z","1.0.5":"2026-10-03T12:41:37.050Z"},"license":"MIT","keywords":["remark","remark-plugin","markdown","wysiwyg","line-break","hard-break","preserve-breaks"],"repository":{"url":"","type":"git"},"description":"A remark plugin that preserves line breaks and empty lines as users intended (WYSIWYG)","maintainers":[{"name":"coreator","email":"coreator.net@gmail.com"}],"readme":"# @coreator/remark-wysiwyg-breaks\r\n\r\nA [remark](https://github.com/remarkjs/remark) plugin that preserves line breaks and empty lines exactly as users intended — achieving true WYSIWYG (What You See Is What You Get) behavior for Markdown.\r\n\r\n## Problem\r\n\r\nIn standard Markdown:\r\n- A single line break is ignored (treated as a space)\r\n- Multiple empty lines are collapsed into one paragraph break\r\n\r\nThis plugin fixes that by:\r\n1. Adding two trailing spaces (hard break) to content lines\r\n2. Converting consecutive empty lines to `<br>` tags\r\n\r\n## Installation\r\n\r\n```bash\r\nnpm install @coreator/remark-wysiwyg-breaks\r\n```\r\n\r\n## Usage\r\n\r\n### With unified/remark\r\n\r\n```ts\r\nimport { unified } from 'unified'\r\nimport remarkParse from 'remark-parse'\r\nimport remarkWysiwygBreaks from '@coreator/remark-wysiwyg-breaks'\r\nimport remarkHtml from 'remark-html'\r\n\r\nconst markdown = `Line 1\r\nLine 2\r\n\r\nLine after one empty line\r\n\r\n\r\nLine after two empty lines`\r\n\r\nconst result = await unified()\r\n  .use(remarkWysiwygBreaks)\r\n  .use(remarkParse)\r\n  .use(remarkHtml)\r\n  .process(markdown)\r\n\r\nconsole.log(String(result))\r\n```\r\n\r\n### Standalone preprocessing\r\n\r\nYou can also use the preprocessing function directly:\r\n\r\n```ts\r\nimport { preprocessMarkdown } from '@coreator/remark-wysiwyg-breaks'\r\n\r\nconst processed = preprocessMarkdown(markdown)\r\n```\r\n\r\n## Options\r\n\r\n| Option | Type | Default | Description |\r\n|--------|------|---------|-------------|\r\n| `preserveFrontmatter` | `boolean` | `true` | Whether to preserve YAML frontmatter without processing |\r\n\r\n```ts\r\nunified()\r\n  .use(remarkWysiwygBreaks, { preserveFrontmatter: false })\r\n```\r\n\r\n## How It Works\r\n\r\n### Markdown Syntax Lines (unchanged)\r\nThe following are recognized as Markdown syntax and left untouched:\r\n- Headings (`# heading`)\r\n- Lists (`- item`, `1. item`)\r\n- Blockquotes (`> quote`)\r\n- Tables (`| cell |`)\r\n- Horizontal rules (`---`, `***`, `___`)\r\n- Code blocks (` ``` `)\r\n\r\n### Content Lines\r\nNon-syntax lines receive two trailing spaces to create hard breaks.\r\n\r\n### Empty Lines\r\n\r\nThe plugin applies context-aware rules:\r\n\r\n| Previous line | Next line | Empty line count | Result |\r\n|---------------|-----------|------------------|--------|\r\n| content | content | 1+ | `<br>` per empty line |\r\n| content | syntax | 1 | paragraph separator only |\r\n| content | syntax | 2+ | `<br>` per empty line |\r\n| syntax | content | 1 | paragraph separator only |\r\n| syntax | content | 2+ | `<br>` per empty line |\r\n| (start of file) | content | 1+ | `<br>` per empty line |\r\n\r\n### Inline HTML Tags (`<i>`, `<em>`, `<b>`, etc.)\r\n\r\nA standalone HTML inline tag on its own line (e.g. `<i>` with nothing else on the line) would normally trigger a CommonMark Type 7 HTML block, causing all line breaks inside to collapse. This plugin handles it automatically:\r\n\r\n**Single-paragraph** — tag is merged onto the next line:\r\n\r\n```markdown\r\n<i>\r\ncontent line\r\nmore content</i>\r\n```\r\n\r\n**Multi-paragraph** — tag is distributed to each paragraph's first and last line, producing valid `<p><i>…</i></p>` for every paragraph:\r\n\r\n```markdown\r\n<i>\r\nFirst paragraph line 1\r\nFirst paragraph line 2\r\n\r\nSecond paragraph.</i>\r\n```\r\n\r\nRenders as:\r\n\r\n```html\r\n<p><i>First paragraph line 1<br>First paragraph line 2</i></p>\r\n<p><i>Second paragraph.</i></p>\r\n```\r\n\r\nMarkdown syntax inside the block (bold, inline code, etc.) continues to work normally.\r\n\r\n## Changelog\r\n\r\nSee [CHANGELOG.md](./docs/CHANGELOG.md).\r\n\r\n## License\r\n\r\nMIT\r\n","readmeFilename":"README.md"}