{"_id":"@alexswt/slate-md-serializer","_rev":"1-4d7cc877e1547ccda0ad71bb1a16d3bc","name":"@alexswt/slate-md-serializer","dist-tags":{"latest":"1.2.3"},"versions":{"1.2.3":{"name":"@alexswt/slate-md-serializer","version":"1.2.3","description":"[![npm version](https://badge.fury.io/js/slate-md-serializer.svg)](https://badge.fury.io/js/slate-md-serializer) [![CircleCI](https://circleci.com/gh/tommoor/slate-md-serializer.svg?style=svg)](https://circleci.com/gh/tommoor/slate-md-serializer)","main":"lib/renderer.js","scripts":{"prepublish":"npm run build","build":"babel src -d lib --ignore test","lint":"eslint src --fix","test":"eslint --ext js,jsx . && prettier --check '**/*.{js,jsx,json,md,html,css}' && jest"},"author":"","license":"MIT","repository":{"type":"git","url":"git://github.com/alshchur/slate-md-serializer.git"},"peerDependencies":{"immutable":">=3.0.0","slate":">=0.34.0"},"devDependencies":{"@babel/cli":"^7.6.4","@babel/core":"^7.6.4","@babel/preset-env":"^7.6.3","@dadi/eslint-config":"^1.1.0","@dadi/prettier-config":"^1.1.0","eslint":"^6.5.1","husky":"^3.0.9","immutable":"^3.8.1","jest":"^24.9.0","lint-staged":"^9.4.2","prettier":"^1.18.2","react":"^15.5.4","react-dom":"^15.5.4","slate":"^0.47.3"},"jest":{"roots":["src"]},"dependencies":{"hashtag-regex":"^2.0.0"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{js,jsx,json,md,html,css}":["prettier --write","git add"]},"gitHead":"aa4f35d0a9c130f0b7b6fc5a1e97cddcae30b788","bugs":{"url":"https://github.com/alshchur/slate-md-serializer/issues"},"homepage":"https://github.com/alshchur/slate-md-serializer#readme","_id":"@alexswt/slate-md-serializer@1.2.3","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-XhPZjjZFAZOHdTJj2UFteuH8qvtfOE2RqZ/h99qS37YeqzOnMRjjwY0LQwQYD1/54OKxIEQt0wD/jUSjJ0UDQw==","shasum":"093b6bff7ed8e4da07afc6fef10c5718a56f7647","tarball":"https://registry.npmjs.org/@alexswt/slate-md-serializer/-/slate-md-serializer-1.2.3.tgz","fileCount":20,"unpackedSize":67183,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfHs8mCRA9TVsSAnZWagAAu00P/i7it/PwgVnYB6J3Pbtg\n6qoOZQktHC3b2WshXxWqAAVH908NUC6UsfO8vznZobhQ2QdIPgyeq9lJH0O+\nHc+3tQKRjHzUSJIdQ+dyHFkhQqClPrN7oL5bQZzM500Is4J9hWyXhNKCF6gX\nVqOmMvsJL9r9lyyjXBxxbPBP/3NlA9e+Q5S0/9AjdjlUvb9Dr5aQC3V+N/l5\nZgdTVY3+po5MXe0dr5Jx3bJ1rokYjJghQLxff6qAtv02PHBXvAc0ekNq7Jp8\nLARZ+4LVjqXDnNS7c6CRY2hmTqP5KJUYvfEdMEp7QVGRTTQjwOIkE7a3meZ6\nGci8/cRMOi1h5OrWrl5RIagIcWduWy05Utq/2NSfyqH7cyg5IZmpdhdSVaKi\n7Q+rwxCS0UlGnNG9QdlfJ9luBd1vCUdSPj2zdVUaTi6rScWO5XmlrEXtl6ev\n+1zXongKzvdyyNoRmHvfx/WsDcJ8pKT4S4tqY5BDBJHGMxEUDe1cc7m+3y0z\n3Rh7SMFRGBHEfKJPKEjZ5s1GxB0wKqIpLqSnsJlcfom2XV5WIuwv/82zFNUO\nMDoCaprQS95ZjFQt0uBp6NvCp7mmLbmyoMKDXweWcOhZcRZN6Bi2W7gKR7TE\npsMWQrReISJUWvEdGJKCfZO8yTCDFhxfw60cNNB5XhGYNOi1MuLECojOwa+z\ndjK0\r\n=5NMg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB3q1Kc6Zrlrqs7Ug9MswZkstMqhR+YLsMGalrtvsLQZAiAZEMyyEywCJUmZlVQsgueJt+qK+/hygyo/a9qGsEEdIg=="}]},"maintainers":[{"name":"alexswt","email":"as@dadi.co"}],"_npmUser":{"name":"alexswt","email":"as@dadi.co"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/slate-md-serializer_1.2.3_1595854629749_0.031079913593123454"},"_hasShrinkwrap":false}},"time":{"created":"2020-07-27T12:57:09.701Z","1.2.3":"2020-07-27T12:57:09.901Z","modified":"2022-04-04T12:41:49.547Z"},"maintainers":[{"name":"alexswt","email":"as@dadi.co"}],"description":"[![npm version](https://badge.fury.io/js/slate-md-serializer.svg)](https://badge.fury.io/js/slate-md-serializer) [![CircleCI](https://circleci.com/gh/tommoor/slate-md-serializer.svg?style=svg)](https://circleci.com/gh/tommoor/slate-md-serializer)","homepage":"https://github.com/alshchur/slate-md-serializer#readme","repository":{"type":"git","url":"git://github.com/alshchur/slate-md-serializer.git"},"bugs":{"url":"https://github.com/alshchur/slate-md-serializer/issues"},"license":"MIT","readme":"[![npm version](https://badge.fury.io/js/slate-md-serializer.svg)](https://badge.fury.io/js/slate-md-serializer) [![CircleCI](https://circleci.com/gh/tommoor/slate-md-serializer.svg?style=svg)](https://circleci.com/gh/tommoor/slate-md-serializer)\n\n# Slate Markdown Serializer\n\nA Markdown serializer for the [Slate Editor](http://slatejs.org). Requires Slate 0.32+.\n\n## renderMark\n\nThis serializer supports the following Slate marks:\n\n```javascript\nfunction renderMark(props) {\n  switch (props.mark.type) {\n    case 'bold':\n      return <strong>{props.children}</strong>\n    case 'code':\n      return <Code>{props.children}</Code>\n    case 'italic':\n      return <em>{props.children}</em>\n    case 'underlined':\n      return <u>{props.children}</u>\n    case 'deleted':\n      return <del>{props.children}</del>\n    case 'added':\n      return <mark>{props.children}</mark>\n    default:\n  }\n}\n```\n\n## renderNode\n\nThis serializer supports the following Slate node keys:\n\n```javascript\nfunction renderNode(props) {\n  const {attributes} = props\n\n  switch (props.node.type) {\n    case 'paragraph':\n      return <Paragraph {...props} />\n    case 'block-quote':\n      return <blockquote {...attributes}>{props.children}</blockquote>\n    case 'bulleted-list':\n      return <ul {...attributes}>{props.children}</ul>\n    case 'ordered-list':\n      return <ol {...attributes}>{props.children}</ol>\n    case 'todo-list':\n      return <ul {...attributes}>{props.children}</ul>\n    case 'table':\n      return <table {...attributes}>{props.children}</table>\n    case 'table-row':\n      return <tr {...attributes}>{props.children}</tr>\n    case 'table-head':\n      return <th {...attributes}>{props.children}</th>\n    case 'table-cell':\n      return <td {...attributes}>{props.children}</td>\n    case 'list-item':\n      return <li {...attributes}>{props.children}</li>\n    case 'horizontal-rule':\n      return <hr />\n    case 'code':\n      return <code {...attributes}>{props.children}</code>\n    case 'image':\n      return <img src={props.src} title={props.title} />\n    case 'link':\n      return <a href={props.href}>{props.children}</a>\n    case 'heading1':\n      return <h1 {...attributes}>{props.children}</h1>\n    case 'heading2':\n      return <h2 {...attributes}>{props.children}</h2>\n    case 'heading3':\n      return <h3 {...attributes}>{props.children}</h3>\n    case 'heading4':\n      return <h4 {...attributes}>{props.children}</h4>\n    case 'heading5':\n      return <h5 {...attributes}>{props.children}</h5>\n    case 'heading6':\n      return <h6 {...attributes}>{props.children}</h6>\n    default:\n  }\n}\n```\n","readmeFilename":"README.md"}