{"_id":"@celsowm/markdown-wysiwyg","_rev":"8-b320675f47a02e6a01e69d442f3b3c92","name":"@celsowm/markdown-wysiwyg","dist-tags":{"latest":"1.0.10"},"versions":{"1.0.0":{"name":"@celsowm/markdown-wysiwyg","version":"1.0.0","keywords":["markdown","editor","wysiwyg","toolbar","javascript","html","converter"],"author":{"name":"Celso Fontes"},"license":"MIT","_id":"@celsowm/markdown-wysiwyg@1.0.0","maintainers":[{"name":"celsowm","email":"celsowm@gmail.com"}],"homepage":"https://github.com/celsowm/markdown-wysiwyg#readme","bugs":{"url":"https://github.com/celsowm/markdown-wysiwyg/issues"},"dist":{"shasum":"7b8cf8c75022a983a6057174034e3da2e513aa9f","tarball":"https://registry.npmjs.org/@celsowm/markdown-wysiwyg/-/markdown-wysiwyg-1.0.0.tgz","fileCount":7,"integrity":"sha512-Htk/kXLhOIiUYyKdtHkjxHUJ91nFf6ES3FEYMxYZez7gRjiNQSAuxMxkUrjOsr+Z9aA0ShZqCoGOHsMTCjrOig==","signatures":[{"sig":"MEUCIHzY3FkONcfH8ODewSUla3A1nxj8s1+FV2d2oLUhBTDrAiEAqYZAXQD09p3wMeV9YPLK2JdqCLYWmwOpq2wJHYgjuc4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":119205},"main":"dist/editor.js","type":"module","style":"dist/editor.css","gitHead":"dd1cb8c643c5ca04fbe14e7202125ee19e2a759b","_npmUser":{"name":"celsowm","email":"celsowm@gmail.com"},"repository":{"url":"git+https://github.com/celsowm/markdown-wysiwyg.git","type":"git"},"_npmVersion":"10.9.2","description":"A simple Markdown WYSIWYG editor with dual-mode editing, toolbar and smart conversion.","directories":{},"_nodeVersion":"22.13.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/markdown-wysiwyg_1.0.0_1749361754041_0.04240617600082297","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@celsowm/markdown-wysiwyg","version":"1.0.3","keywords":["markdown","editor","wysiwyg","toolbar","javascript","html","converter"],"author":{"name":"Celso Fontes"},"license":"MIT","_id":"@celsowm/markdown-wysiwyg@1.0.3","maintainers":[{"name":"celsowm","email":"celsowm@gmail.com"}],"homepage":"https://github.com/celsowm/markdown-wysiwyg#readme","bugs":{"url":"https://github.com/celsowm/markdown-wysiwyg/issues"},"dist":{"shasum":"b48c11a77636a522aa96f70e10722d8fbb441680","tarball":"https://registry.npmjs.org/@celsowm/markdown-wysiwyg/-/markdown-wysiwyg-1.0.3.tgz","fileCount":7,"integrity":"sha512-Irnudu63WNsNG9DXl9z6g0uGno2KtzQYkjGZ3g4aVi/xZvQvBCWFbILYIKv07TeIPjp+oTjDKhNJO4i237BfvQ==","signatures":[{"sig":"MEQCIFqcfFXto/MZkTn/SYzEZ9tSMwvnSQ2YpdCxtH8MNfj+AiB3z9D4V5vHENhqu72l/EG24agEb0zBWv6sP+gXWPUsfQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":182843},"main":"dist/editor.js","type":"module","style":"dist/editor.css","gitHead":"58cd59b84de28586c6b7a4cb42d432850766f62f","_npmUser":{"name":"celsowm","email":"celsowm@gmail.com"},"repository":{"url":"git+https://github.com/celsowm/markdown-wysiwyg.git","type":"git"},"_npmVersion":"10.9.2","description":"A simple Markdown WYSIWYG editor with dual-mode editing, toolbar and smart conversion.","directories":{},"_nodeVersion":"22.13.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/markdown-wysiwyg_1.0.3_1749916689453_0.594144669738732","host":"s3://npm-registry-packages-npm-production"}},"1.0.4":{"name":"@celsowm/markdown-wysiwyg","version":"1.0.4","keywords":["markdown","editor","wysiwyg","toolbar","javascript","html","converter"],"author":{"name":"Celso Fontes"},"license":"MIT","_id":"@celsowm/markdown-wysiwyg@1.0.4","maintainers":[{"name":"celsowm","email":"celsowm@gmail.com"}],"homepage":"https://github.com/celsowm/markdown-wysiwyg#readme","bugs":{"url":"https://github.com/celsowm/markdown-wysiwyg/issues"},"dist":{"shasum":"b19cb1ccb32b80a8583ada26c5b5e49ea326a7ad","tarball":"https://registry.npmjs.org/@celsowm/markdown-wysiwyg/-/markdown-wysiwyg-1.0.4.tgz","fileCount":7,"integrity":"sha512-cVJXO06KhxHDb92cyz7RprFNHulVzOLseK/noa9w5Gmm9HGII/gKWXOP5V4DOD1yXxkl0KoQ0zMTIs40DqABFg==","signatures":[{"sig":"MEUCIQDHhb4mAu65g1mSvFNC5Tb9atR03rO6+oXgjJJ6hN7NVwIgJho3V4Hq18Ts4G53H7fP/DcGstcJ8QMe4WorXHulrTQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":152398},"main":"dist/editor.js","type":"module","style":"dist/editor.css","gitHead":"7e1beb4f026e1ccaef92f33d040d259e8254889e","_npmUser":{"name":"celsowm","email":"celsowm@gmail.com"},"repository":{"url":"git+https://github.com/celsowm/markdown-wysiwyg.git","type":"git"},"_npmVersion":"10.9.2","description":"A simple Markdown WYSIWYG editor with dual-mode editing, toolbar and smart conversion.","directories":{},"_nodeVersion":"22.13.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/markdown-wysiwyg_1.0.4_1749920115447_0.6790613650678814","host":"s3://npm-registry-packages-npm-production"}},"1.0.5":{"name":"@celsowm/markdown-wysiwyg","version":"1.0.5","keywords":["markdown","editor","wysiwyg","toolbar","javascript","html","converter"],"author":{"name":"Celso Fontes"},"license":"MIT","_id":"@celsowm/markdown-wysiwyg@1.0.5","maintainers":[{"name":"celsowm","email":"celsowm@gmail.com"}],"homepage":"https://github.com/celsowm/markdown-wysiwyg#readme","bugs":{"url":"https://github.com/celsowm/markdown-wysiwyg/issues"},"dist":{"shasum":"dfc75e9e95b48c368f7c100eaeab47c42e41792f","tarball":"https://registry.npmjs.org/@celsowm/markdown-wysiwyg/-/markdown-wysiwyg-1.0.5.tgz","fileCount":7,"integrity":"sha512-6uFZfeyk9Tgp2Bw2GxvTdflmgPKG7TmQp+7Rs2gy7ClwGnR/Uj2Tpylx/DI27Jg9EU/uiN+2grCEhyb5WKnRTg==","signatures":[{"sig":"MEUCIQDNUU9qJmSStzawGak1Rg+/L64R8wNaqR8yyhdzieRlGgIgJrljyEPes8ihdUHPMb/Fo0mvm0zF+AxCf2z7++Zjw/w=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":161246},"main":"dist/editor.js","type":"module","style":"dist/editor.css","gitHead":"6da81ceb554225481e60cd58c21a6336b88feb1a","_npmUser":{"name":"celsowm","actor":{"name":"celsowm","type":"user","email":"celsowm@gmail.com"},"email":"celsowm@gmail.com"},"repository":{"url":"git+https://github.com/celsowm/markdown-wysiwyg.git","type":"git"},"_npmVersion":"10.9.2","description":"A simple Markdown WYSIWYG editor with dual-mode editing, toolbar and smart conversion.","directories":{},"_nodeVersion":"22.13.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/markdown-wysiwyg_1.0.5_1750156944157_0.10436072899238491","host":"s3://npm-registry-packages-npm-production"}},"1.0.6":{"name":"@celsowm/markdown-wysiwyg","version":"1.0.6","keywords":["markdown","editor","wysiwyg","toolbar","javascript","html","converter"],"author":{"name":"Celso Fontes"},"license":"MIT","_id":"@celsowm/markdown-wysiwyg@1.0.6","maintainers":[{"name":"celsowm","email":"celsowm@gmail.com"}],"homepage":"https://github.com/celsowm/markdown-wysiwyg#readme","bugs":{"url":"https://github.com/celsowm/markdown-wysiwyg/issues"},"dist":{"shasum":"54ba5992c32838551571c2dcf3eda31d4936d7dc","tarball":"https://registry.npmjs.org/@celsowm/markdown-wysiwyg/-/markdown-wysiwyg-1.0.6.tgz","fileCount":7,"integrity":"sha512-+7Cq2JAEcKbXl7bwZ9jVTEFOPovszQuhVzW3rIZN8Zqb2t5Q6zTKSMc2+QpUw5rv2QsqnNpTPu03UjeM2e64Eg==","signatures":[{"sig":"MEYCIQDhZFl/7h29bOlfqxziqEmZW/Ml43kxG9E+XuVj0+a3hQIhAJOp07NBBUPtrh8LDy0h97vxj0uE0MiYGlvvOMKmNNZe","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":162847},"main":"dist/editor.js","type":"module","style":"dist/editor.css","gitHead":"12b0740e9b862aa7b3f94063f5bad5073ef62921","_npmUser":{"name":"celsowm","actor":{"name":"celsowm","type":"user","email":"celsowm@gmail.com"},"email":"celsowm@gmail.com"},"repository":{"url":"git+https://github.com/celsowm/markdown-wysiwyg.git","type":"git"},"_npmVersion":"10.9.2","description":"A simple Markdown WYSIWYG editor with dual-mode editing, toolbar and smart conversion.","directories":{},"_nodeVersion":"22.13.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/markdown-wysiwyg_1.0.6_1750206395212_0.7867516468196742","host":"s3://npm-registry-packages-npm-production"}},"1.0.8":{"name":"@celsowm/markdown-wysiwyg","version":"1.0.8","keywords":["markdown","editor","wysiwyg","toolbar","javascript","html","converter"],"author":{"name":"Celso Fontes"},"license":"MIT","_id":"@celsowm/markdown-wysiwyg@1.0.8","maintainers":[{"name":"celsowm","email":"celsowm@gmail.com"}],"homepage":"https://github.com/celsowm/markdown-wysiwyg#readme","bugs":{"url":"https://github.com/celsowm/markdown-wysiwyg/issues"},"dist":{"shasum":"c1524cc1c1d963b9fd55dfbdd468cc04cfd70741","tarball":"https://registry.npmjs.org/@celsowm/markdown-wysiwyg/-/markdown-wysiwyg-1.0.8.tgz","fileCount":10,"integrity":"sha512-q5KJYNqXkAuIP/WkRPUSr+5DGw9m0XfKTboiJkhWHTXyUustUlBuMfyyQubaxr6Goku94l+SuagoNSlUUi3AQQ==","signatures":[{"sig":"MEUCIQDxrixUO9uL++oGj/yU7B7xEGUPOf47q+43rAnxf7/pYwIgO0JtLEx0ZQVXLUYXd5vvtx1FjiioeOw7s+5MyulWygs=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEYCIQCSCuOIFD8aezRLUyN5d6zbvCBwArab4UJ+lCaPvGOtCgIhAJDnEfnO3kToXLR3NIFflH7/zW6t/I9lPp6s45I6tjN+","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@celsowm%2fmarkdown-wysiwyg@1.0.8","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":306045},"main":"./dist/editor.esm.js","type":"module","style":"dist/editor.css","module":"./dist/editor.esm.js","exports":{".":"./dist/editor.esm.js","./editor.css":"./dist/editor.css","./package.json":"./package.json","./dist/editor.css":"./dist/editor.css"},"gitHead":"e00fb56b76c79de95940eee890442f4f5a552e04","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:c6cd7e8a-b126-485d-a784-5367a529a6f1"}},"repository":{"url":"git+https://github.com/celsowm/markdown-wysiwyg.git","type":"git"},"_npmVersion":"12.0.2","description":"A simple Markdown WYSIWYG editor with dual-mode editing, toolbar and smart conversion.","directories":{},"_nodeVersion":"24.20.0","_hasShrinkwrap":false,"peerDependencies":{"marked":">=12.0.0"},"_npmOperationalInternal":{"tmp":"tmp/markdown-wysiwyg_1.0.8_1789664328035_0.8536846096741539","host":"s3://npm-registry-packages-npm-production"}},"1.0.9":{"name":"@celsowm/markdown-wysiwyg","version":"1.0.9","keywords":["markdown","editor","wysiwyg","toolbar","javascript","html","converter"],"author":{"name":"Celso Fontes"},"license":"MIT","_id":"@celsowm/markdown-wysiwyg@1.0.9","maintainers":[{"name":"celsowm","email":"celsowm@gmail.com"}],"homepage":"https://github.com/celsowm/markdown-wysiwyg#readme","bugs":{"url":"https://github.com/celsowm/markdown-wysiwyg/issues"},"dist":{"shasum":"768077840c50c7108e63573bab4ef5ad0c57d082","tarball":"https://registry.npmjs.org/@celsowm/markdown-wysiwyg/-/markdown-wysiwyg-1.0.9.tgz","fileCount":9,"integrity":"sha512-aOtgGqYlIsGLLsKwJKzScEE1UEDCFQJSedmuJTSrxXmiFfdYH5TYZ75IU82ye5H1jMgqPGx32+o9POsl36kzfA==","signatures":[{"sig":"MEUCIDBN3k7xsPYjlfUthLKmr7u3BJX1p6W/kcKVGxG7Bjy8AiEApDRQvymlhdHCn2YYcMqA9l6HRbbG5036iXduJm1UonI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIHcJqlbQ3vJWicUtfrG0BChfdU0EFb63Rzqz79v6Z1yNAiEAkew8rHcBFuk5h3CQ5jmVi2rgnm10k/9x2rACJDC3hUk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@celsowm%2fmarkdown-wysiwyg@1.0.9","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":297998},"main":"./dist/editor.esm.js","type":"module","style":"dist/editor.css","module":"./dist/editor.esm.js","exports":{".":"./dist/editor.esm.js","./editor.css":"./dist/editor.css","./package.json":"./package.json","./dist/editor.css":"./dist/editor.css"},"gitHead":"14510364bcdd9891bd1d9c258f3c119bc1a599ad","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:c6cd7e8a-b126-485d-a784-5367a529a6f1"}},"repository":{"url":"git+https://github.com/celsowm/markdown-wysiwyg.git","type":"git"},"_npmVersion":"12.0.2","description":"A simple Markdown WYSIWYG editor with dual-mode editing, toolbar and smart conversion.","directories":{},"_nodeVersion":"24.20.0","_hasShrinkwrap":false,"peerDependencies":{"marked":">=12.0.0"},"_npmOperationalInternal":{"tmp":"tmp/markdown-wysiwyg_1.0.9_1789665039938_0.3920962092134497","host":"s3://npm-registry-packages-npm-production"}},"1.0.10":{"_id":"@celsowm/markdown-wysiwyg@1.0.10","bugs":{"url":"https://github.com/celsowm/markdown-wysiwyg/issues"},"dist":{"shasum":"310ae8ea33987a2b81c446745f08d8901d0db07e","tarball":"https://registry.npmjs.org/@celsowm/markdown-wysiwyg/-/markdown-wysiwyg-1.0.10.tgz","fileCount":9,"integrity":"sha512-DSZjrSB5KG8e9Y/nIOzDKBQB0qV/Dv7Eqx6//EecfzDaRASkwQlQtGR1rgkQhvaZC9XnCp0nAbGTM+6b93wYmg==","signatures":[{"sig":"MEUCIHEkxKaTaw0NllUT2CR787asFHsVQaCAUmT8c+qkaSk8AiEA7z7cpxw/8e95XkukMWrMy+Ixx9Qwv5GawNcjgHal9Go=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIFC0TfGQlAdXni+V/kfby+um7GDzjMwerElb/UkFreePAiEAwdvsdqVn3PuFBmwpKaXuq0RgXKf6JUUgXcmOi3gibsA="}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@celsowm%2fmarkdown-wysiwyg@1.0.10","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":298017},"main":"./dist/editor.esm.js","name":"@celsowm/markdown-wysiwyg","type":"module","style":"dist/editor.css","author":{"name":"Celso Fontes"},"module":"./dist/editor.esm.js","exports":{".":"./dist/editor.esm.js","./editor.css":"./dist/editor.css","./package.json":"./package.json","./dist/editor.css":"./dist/editor.css"},"gitHead":"8ca8faae01e1d503525da4722fc0b647405a8a39","license":"MIT","version":"1.0.10","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:c6cd7e8a-b126-485d-a784-5367a529a6f1"}},"homepage":"https://github.com/celsowm/markdown-wysiwyg#readme","keywords":["markdown","editor","wysiwyg","toolbar","javascript","html","converter"],"repository":{"url":"git+https://github.com/celsowm/markdown-wysiwyg.git","type":"git"},"_npmVersion":"12.0.2","description":"A simple Markdown WYSIWYG editor with dual-mode editing, toolbar and smart conversion.","directories":{},"maintainers":[{"name":"celsowm","email":"celsowm@gmail.com"}],"_nodeVersion":"24.20.0","_hasShrinkwrap":false,"peerDependencies":{"marked":">=12.0.0"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/markdown-wysiwyg_1.0.10_1789673324661_0.8329539321062829"}}},"time":{"created":"2025-06-08T05:49:13.928Z","modified":"2026-09-17T19:28:45.075Z","1.0.0":"2025-06-08T05:49:14.259Z","1.0.3":"2025-06-14T15:58:09.688Z","1.0.4":"2025-06-14T16:55:15.659Z","1.0.5":"2025-06-17T10:42:24.343Z","1.0.6":"2025-06-18T00:26:35.437Z","1.0.8":"2026-09-17T16:58:48.126Z","1.0.9":"2026-09-17T17:10:40.047Z","1.0.10":"2026-09-17T19:28:44.771Z"},"bugs":{"url":"https://github.com/celsowm/markdown-wysiwyg/issues"},"author":{"name":"Celso Fontes"},"license":"MIT","homepage":"https://github.com/celsowm/markdown-wysiwyg#readme","keywords":["markdown","editor","wysiwyg","toolbar","javascript","html","converter"],"repository":{"url":"git+https://github.com/celsowm/markdown-wysiwyg.git","type":"git"},"description":"A simple Markdown WYSIWYG editor with dual-mode editing, toolbar and smart conversion.","maintainers":[{"name":"celsowm","email":"celsowm@gmail.com"}],"readme":"\n# Markdown WYSIWYG Editor\n\nA versatile JavaScript-based Markdown editor that offers a seamless experience by allowing users to switch between a What-You-See-Is-What-You-Get (WYSIWYG) visual editor and a raw Markdown text editor. It comes with a customizable toolbar, undo/redo functionality, and intelligent Markdown-to-HTML (and vice-versa) conversion.\n\n![image](https://github.com/user-attachments/assets/26d74f49-9094-4336-a951-71919388145d)\n\n## Features\n\n- **Dual Editing Modes:**\n  - **WYSIWYG Mode:** Edit rich text visually with familiar formatting tools.\n  - **Markdown Mode:** Directly write and edit Markdown syntax in a textarea.\n- **Easy Mode Switching:** Instantly toggle between WYSIWYG and Markdown views using intuitive tabs.\n- **Comprehensive Toolbar:**\n  - Headings (H1, H2, H3)\n  - Bold, Italic, Strikethrough\n  - Hyperlinks\n  - Unordered and Ordered Lists\n  - Indent and Outdent (for lists)\n  - Blockquotes\n  - Horizontal Rules\n  - Tables (with interactive grid selector)\n  - Code Blocks and Inline Code\n  - SVG icons for a clean and modern look\n- **Smart Conversion:**\n  - Uses Marked.js for Markdown → HTML\n  - Custom-built HTML → Markdown parser\n- **Undo/Redo** support in both modes\n- **Customizable:**\n  - Initial value\n  - Toolbar visibility\n  - Toolbar buttons\n  - Table grid dimensions\n  - `onUpdate` callback\n- **Keyboard Shortcuts:**\n  - `Tab` / `Shift+Tab`: Indent/outdent, table cell nav\n  - `Ctrl+Z` / `Cmd+Z`: Undo\n  - `Ctrl+Y` / `Ctrl+Shift+Z`: Redo\n- **Lightweight and self-contained**\n- Built-in toolbar button titles/tooltips are in English.\n\n## Demo\n\nYou can run the `index.html` file in your browser to see a live demonstration of the editor.  \nOr online here: [demo](https://celsowm.github.io/markdown-wysiwyg/)\n\n## NPM / ES Modules\n\nInstall the editor and its Markdown parser peer dependency:\n\n```bash\nnpm install @celsowm/markdown-wysiwyg marked\n```\n\nThen import the editor and stylesheet:\n\n```js\nimport MarkdownWYSIWYG from '@celsowm/markdown-wysiwyg';\nimport '@celsowm/markdown-wysiwyg/dist/editor.css';\n\nconst editor = new MarkdownWYSIWYG('myMarkdownEditor', {\n  initialValue: '## Hello from ESM'\n});\n```\n\nA named export is also available:\n\n```js\nimport { MarkdownWYSIWYG } from '@celsowm/markdown-wysiwyg';\n```\n\n## Installation / Setup\n\n**Include CSS:**\n\n```html\n<link rel=\"stylesheet\" href=\"dist/editor.css\">\n```\n\n**Include JavaScript:**\n\n```html\n<!-- Dependency: Marked.js -->\n<script src=\"https://cdn.jsdelivr.net/npm/marked/marked.min.js\"></script>\n\n<!-- Editor Script -->\n<script src=\"dist/editor.js\"></script>\n```\n\n**Create an HTML Container:**\n\n```html\n<div id=\"myMarkdownEditor\"></div>\n```\n\n**Initialize via JavaScript:**\n\n```html\n<script>\ndocument.addEventListener('DOMContentLoaded', () => {\n  const editor = new MarkdownWYSIWYG('myMarkdownEditor', {\n    initialValue: \"## Hello World!\\n\\nThis is **Markdown** content.\",\n    onUpdate: (markdownContent) => {\n      console.log(\"Updated content:\", markdownContent);\n    }\n  });\n});\n</script>\n```\n\n## Options\n\n| Option             | Type     | Default | Description                              |\n|--------------------|----------|---------|------------------------------------------|\n| initialValue       | string   | ''      | The initial Markdown content to load.    |\n| showToolbar        | boolean  | true    | Whether to display the toolbar.          |\n| buttons            | array    | default | Custom toolbar button list.              |\n| onUpdate           | function | null    | Callback triggered on content change.    |\n| initialMode        | string   | 'wysiwyg' | Starting mode: `'wysiwyg'` or `'markdown'`. |\n| tableGridMaxRows   | number   | 10      | Max rows in the insert table selector grid. |\n| tableGridMaxCols   | number   | 10      | Max columns in the insert table selector grid. |\n\n## Public Methods\n\n- `getValue()`: Returns the current Markdown content as string.\n- `setValue(markdownString, isInitialSetup)`: Sets the content of the editor. Public calls trigger `onUpdate`; internal initial setup does not.\n- `switchToMode(mode)`: Switches mode: `'wysiwyg'` or `'markdown'`.\n- `destroy()`: Destroys the editor and cleans up listeners.\n\n## CDN Usage\n\n```html\n<link rel=\"stylesheet\" href=\"https://cdn.jsdelivr.net/gh/celsowm/markdown-wysiwyg/dist/editor.css\" />\n<script src=\"https://cdn.jsdelivr.net/npm/marked/marked.min.js\"></script>\n<script src=\"https://cdn.jsdelivr.net/gh/celsowm/markdown-wysiwyg@latest/dist/editor.js\"></script>\n```\n\n## HTML → Markdown Conversion\n\nThe `_htmlToMarkdown` function (and helpers) recursively convert HTML from the visual editor into valid Markdown:\n\n- Converts tags like `<b>`, `<em>`, `<h1>`, `<ul>`, `<table>`, `<code>`, etc.\n- Detects code blocks and inline code\n- Properly formats nested lists and blockquotes\n- Escapes special characters (`|`, `_`, etc.)\n- Handles `<th>` vs `<td>` to produce proper Markdown tables\n\n## Contributing\n\nContributions are welcome!\n\n1. Fork the repo  \n2. Create a feature branch  \n3. Commit and push  \n4. Open a pull request\n\n## License\n\nMIT License. See `LICENSE` file for details.\n","readmeFilename":"README.md"}