{"_id":"@boundless-inc/mobiledoc-dom-renderer","_rev":"2-42cf9335a7934946f3cc71b0464c556f","name":"@boundless-inc/mobiledoc-dom-renderer","dist-tags":{"latest":"0.6.5"},"versions":{"0.6.5":{"name":"@boundless-inc/mobiledoc-dom-renderer","version":"0.6.5","description":"Renders Mobiledoc input to DOM output","scripts":{"start":"broccoli serve","test":"testem ci","build":"rm -rf dist/ && broccoli build dist","prepublish":"npm run build","build:tests":"rm -rf tests && BROCCOLI_ENV=tests broccoli build tests","update-changelog":"conventional-changelog -i CHANGELOG.md -r 0 -s","version":"npm run update-changelog && git add CHANGELOG.md"},"repository":{"type":"git","url":"git+https://github.com/boundless-inc/mobiledoc-dom-renderer.git"},"keywords":["mobiledoc","mobiledoc-renderer","content-kit"],"author":{"name":"Cory Forsyth","email":"cory.forsyth@gmail.com","url":"http://coryforsyth.com/"},"license":"MIT","bugs":{"url":"https://github.com/boundless-inc/mobiledoc-dom-renderer/issues"},"files":["dist","lib","index.js"],"homepage":"https://github.com/boundless-inc/mobiledoc-dom-renderer","devDependencies":{"broccoli":"^0.16.3","broccoli-funnel":"^1.1.0","broccoli-merge-trees":"^0.2.1","broccoli-multi-builder":"^0.2.6","broccoli-test-builder":"^0.2.0","conventional-changelog":"^1.1.0","conventional-changelog-cli":"^1.1.1","simple-dom":"^0.3.2","testem":"^1.15.0"},"main":"dist/commonjs/mobiledoc-dom-renderer/index.js","directories":{"lib":"lib","test":"tests"},"dependencies":{"add-stream":"^1.0.0","after":"^0.8.1","accepts":"^1.3.3","acorn":"^3.3.0","amdefine":"^1.0.1","alter":"^0.2.0","ansi-regex":"^0.2.1","ansi-styles":"^1.1.0","align-text":"^0.1.4","applause":"^0.4.3","are-we-there-yet":"^1.1.5","argparse":"^1.0.9","aproba":"^1.2.0","JSONStream":"^1.2.1","array-equal":"^1.0.0","array-ify":"^1.0.0","array-flatten":"^1.1.1","array-find-index":"^1.0.2","ast-types":"^0.8.15","async":"^0.2.10","async-disk-cache":"^1.0.9","babel-plugin-dead-code-elimination":"^1.0.2","babel-core":"^5.8.38","babel-plugin-constant-folding":"^1.0.1","babel-plugin-eval":"^1.0.1","arraybuffer.slice":"^0.0.6","babel-plugin-jscript":"^1.0.4","babel-plugin-inline-environment-variables":"^1.0.1","babel-plugin-member-expression-literals":"^1.0.1","babel-plugin-property-literals":"^1.0.1","babel-plugin-proto-to-assign":"^1.0.4","babel-plugin-react-constant-elements":"^1.0.3","babel-plugin-runtime":"^1.0.7","babel-plugin-remove-debugger":"^1.0.1","babel-plugin-undeclared-variables-check":"^1.0.2","babel-plugin-remove-console":"^1.0.1","backo2":"^1.0.2","babel-plugin-undefined-to-void":"^1.1.6","babylon":"^5.8.38","backbone":"^1.3.3","base64id":"^0.1.0","binaryextensions":"^2.0.0","base64-arraybuffer":"^0.1.5","better-assert":"^1.0.2","balanced-match":"^0.4.2","blank-object":"^1.0.2","bluebird":"^3.5.1","blob":"^0.0.4","breakable":"^1.0.0","broccoli-amd-loader":"^0.1.0","broccoli-babel-transpiler":"^5.6.1","brace-expansion":"^1.1.6","broccoli-concat":"^0.0.13","broccoli-filter":"^1.2.4","broccoli-caching-writer":"^2.3.1","broccoli-jshint":"^0.5.8","broccoli-kitchen-sink-helpers":"^0.2.9","broccoli-plugin":"^1.2.2","broccoli-replace":"^0.3.3","broccoli-persistent-filter":"^1.2.11","broccoli-stew":"^0.3.6","buffer-shims":"^1.0.0","broccoli-sourcemap-concat":"^2.0.2","broccoli-slow-trees":"^1.1.0","broccoli-writer":"^0.1.1","camelcase-keys":"^2.1.0","builtin-modules":"^1.1.1","callsite":"^1.0.0","camelcase":"^1.2.1","center-align":"^0.1.3","chalk":"^0.5.1","cli":"^1.0.1","clone":"^0.2.0","cliui":"^2.1.0","can-symlink":"^1.0.0","charm":"^1.0.1","code-point-at":"^1.1.0","compare-func":"^1.3.2","commander":"^2.9.0","commoner":"^0.10.4","component-emitter":"^1.2.1","component-inherit":"^0.0.3","component-bind":"^1.0.0","concat-map":"^0.0.1","connect":"^3.5.0","console-control-strings":"^1.1.0","console-browserify":"^1.1.0","content-type":"^1.0.2","consolidate":"^0.14.5","conventional-changelog-codemirror":"^0.1.0","content-disposition":"^0.5.1","conventional-changelog-angular":"^1.3.0","conventional-changelog-atom":"^0.1.0","conventional-changelog-eslint":"^0.1.0","conventional-changelog-ember":"^0.2.2","conventional-changelog-core":"^1.5.0","conventional-changelog-jscs":"^0.1.0","conventional-changelog-jquery":"^0.1.0","conventional-changelog-express":"^0.1.0","conventional-changelog-jshint":"^0.1.0","conventional-changelog-writer":"^1.4.1","conventional-commits-parser":"^1.3.0","convert-source-map":"^1.3.0","conventional-commits-filter":"^1.0.0","cookie-signature":"^1.0.6","cookie":"^0.3.1","ast-traverse":"^0.1.1","copy-dereference":"^1.0.0","core-js":"^1.2.7","core-util-is":"^1.0.2","cson-parser":"^1.3.4","cross-spawn":"^5.1.0","currently-unhandled":"^0.4.1","date-now":"^0.1.4","dargs":"^4.1.0","debug":"^2.3.2","dateformat":"^1.0.12","defined":"^1.0.0","decamelize":"^1.2.0","defs":"^1.1.1","delegates":"^1.0.0","depd":"^1.1.0","destroy":"^1.0.4","detect-indent":"^3.0.1","domelementtype":"^1.3.0","dom-serializer":"^0.1.0","detective":"^4.3.2","domhandler":"^2.3.0","ee-first":"^1.1.1","editions":"^1.3.3","dot-prop":"^3.0.0","domutils":"^1.5.1","encodeurl":"^1.0.1","engine.io":"^1.8.0","engine.io-parser":"^1.3.1","entities":"^1.0.0","ensure-posix-path":"^1.0.2","engine.io-client":"^1.8.0","escape-string-regexp":"^1.0.5","escape-html":"^1.0.3","esprima":"^2.7.3","error-ex":"^1.3.0","esprima-fb":"^15001.1001.0-dev-harmony-fb","etag":"^1.7.0","exit":"^0.1.2","esutils":"^2.0.2","events-to-array":"^1.0.2","eventemitter3":"^3.1.0","exists-sync":"^0.0.4","express":"^4.14.0","fast-ordered-set":"^1.0.3","fast-sourcemap-concat":"^0.2.7","finalhandler":"^0.5.0","find-up":"^1.1.2","fireworm":"^0.7.1","forwarded":"^0.1.0","findup-sync":"^0.2.1","follow-redirects":"^1.5.0","fs-extra":"^0.13.0","fresh":"^0.3.0","fs-readdir-recursive":"^0.1.2","fs-tree-diff":"^0.5.3","fs.realpath":"^1.0.0","gauge":"^2.7.4","get-stdin":"^4.0.1","get-pkg-repo":"^1.3.0","gitconfiglocal":"^1.0.0","git-remote-origin-url":"^2.0.0","git-raw-commits":"^1.1.2","git-semver-tags":"^1.1.2","glob":"^5.0.15","graceful-readlink":"^1.0.1","graceful-fs":"^4.1.10","github-url-from-git":"^1.4.0","babel-plugin-react-display-name":"^1.0.3","globals":"^6.4.1","handlebars":"^4.0.6","has-color":"^0.1.7","growly":"^1.3.0","has-ansi":"^0.1.0","has-binary":"^0.1.7","has-cors":"^1.1.0","has-unicode":"^2.0.1","hosted-git-info":"^2.1.5","home-or-tmp":"^1.0.0","hash-for-dep":"^1.0.3","heimdalljs-logger":"^0.1.7","htmlparser2":"^3.8.3","heimdalljs":"^0.2.1","http-errors":"^1.5.0","iconv-lite":"^0.4.13","http-proxy":"^1.17.0","inflight":"^1.0.6","indent-string":"^2.1.0","ini":"^1.3.4","indexof":"^0.0.1","invert-kv":"^1.0.0","inherits":"^2.0.3","is-arrayish":"^0.2.1","is-buffer":"^1.1.4","is-finite":"^1.0.2","ipaddr.js":"^1.1.1","is-builtin-module":"^1.0.0","is-subset":"^0.1.1","is-integer":"^1.0.6","is-obj":"^1.0.1","is-type":"^0.0.1","is-utf8":"^0.2.1","is-text-path":"^1.0.1","isarray":"^0.0.1","is-fullwidth-code-point":"^1.0.0","istextorbinary":"^2.1.0","isexe":"^2.0.0","js-yaml":"^3.7.0","js-tokens":"^1.0.1","jsesc":"^0.5.0","js-string-escape":"^1.0.1","json3":"^3.3.2","jshint":"^2.9.4","json-stringify-safe":"^5.0.1","json5":"^0.4.0","json-stable-stringify":"^1.0.1","jsonfile":"^2.4.0","kind-of":"^3.0.4","lazy-cache":"^1.0.4","jsonify":"^0.0.0","jsonparse":"^1.2.0","load-json-file":"^1.1.0","loader.js":"^3.6.0","leven":"^1.0.2","lcid":"^1.0.0","lodash._baseflatten":"^3.1.4","lodash._basecallback":"^3.3.1","lodash":"^3.10.1","lodash-node":"^2.4.1","lodash._baseisequal":"^3.0.7","lodash._cacheindexof":"^3.0.2","lodash._baseuniq":"^3.0.3","lodash._baseindexof":"^3.1.0","lodash._bindcallback":"^3.0.1","lodash._reinterpolate":"^3.0.0","lodash._createcache":"^3.1.2","lodash.assignin":"^4.2.0","lodash._isiterateecall":"^3.0.9","lodash._getnative":"^3.9.1","lodash.find":"^4.6.0","lodash.debounce":"^3.1.1","lodash.flatten":"^3.0.2","lodash.keys":"^3.1.2","lodash.clonedeep":"^4.5.0","lodash.isarray":"^3.0.4","lodash.isarguments":"^3.1.0","lodash.pairs":"^3.0.1","lodash.istypedarray":"^3.0.6","lodash.template":"^4.4.0","lodash.templatesettings":"^4.1.0","longest":"^1.0.1","loud-rejection":"^1.6.0","lodash.uniq":"^3.2.2","lodash.uniqby":"^4.7.0","lru-cache":"^4.1.3","matcher-collection":"^1.0.4","md5-hex":"^1.3.0","merge-descriptors":"^1.0.1","md5-o-matic":"^0.1.1","meow":"^3.7.0","media-typer":"^0.3.0","map-obj":"^1.0.1","mime":"^1.3.4","methods":"^1.1.2","mime-db":"^1.24.0","minimist":"^0.0.8","mktemp":"^0.4.0","minimatch":"^2.0.10","mkdirp":"^0.5.1","modify-values":"^1.0.0","mustache":"^2.3.0","mime-types":"^2.1.12","ms":"^0.7.1","ncp":"^1.0.1","node-notifier":"^5.2.1","negotiator":"^0.6.1","number-is-nan":"^1.0.1","npmlog":"^4.1.2","normalize-package-data":"^2.3.5","object-assign":"^4.1.0","once":"^1.4.0","object-component":"^0.0.3","on-finished":"^2.3.0","os-locale":"^1.4.0","os-tmpdir":"^1.0.2","output-file-sync":"^1.1.2","parse-github-repo-url":"^1.3.0","optimist":"^0.6.1","options":"^0.0.6","parse-json":"^2.2.0","parsejson":"^0.0.3","parseuri":"^0.0.5","parseurl":"^1.3.1","path-is-absolute":"^1.0.1","path-posix":"^1.0.0","parseqs":"^0.0.5","path-type":"^1.1.0","pinkie-promise":"^2.0.1","path-to-regexp":"^0.1.7","pify":"^2.3.0","pinkie":"^2.0.4","printf":"^0.2.5","process-nextick-args":"^1.0.7","path-exists":"^1.0.0","proxy-addr":"^1.1.2","promise-map-series":"^0.2.3","pseudomap":"^1.0.2","private":"^0.1.6","q":"^1.4.1","qs":"^6.2.0","quick-temp":"^0.1.6","range-parser":"^1.2.0","read-pkg-up":"^1.0.1","read-pkg":"^1.1.0","qunitjs":"^1.23.1","recast":"^0.10.43","redent":"^1.0.0","readable-stream":"^2.2.2","regenerate":"^1.3.2","regenerator":"^0.8.40","regjsparser":"^0.1.5","regjsgen":"^0.2.0","repeat-string":"^1.6.1","regexpu":"^1.3.0","repeating":"^1.1.3","requires-port":"^1.0.0","right-align":"^0.1.3","rimraf":"^2.5.4","resolve":"^1.1.7","rsvp":"^3.3.3","semver":"^5.3.0","safe-buffer":"^5.1.2","set-blocking":"^2.0.0","send":"^0.14.1","setprototypeof":"^1.0.1","serve-static":"^1.11.1","shebang-command":"^1.2.0","shelljs":"^0.3.0","sigmund":"^1.0.1","shebang-regex":"^1.0.0","simple-is":"^0.2.0","shellwords":"^0.1.1","simple-fmt":"^0.1.0","slash":"^1.0.0","socket.io":"^1.6.0","signal-exit":"^3.0.1","socket.io-client":"^1.6.0","socket.io-adapter":"^0.5.0","source-map-support":"^0.2.10","socket.io-parser":"^2.3.1","source-map":"^0.5.6","source-map-url":"^0.3.0","spdx-correct":"^1.0.2","spawn-args":"^0.2.0","split":"^1.0.0","spdx-expression-parse":"^1.0.4","spdx-license-ids":"^1.2.2","sprintf-js":"^1.0.3","split2":"^2.1.0","stable":"^0.1.5","string_decoder":"^0.10.31","string-width":"^1.0.2","stringmap":"^0.2.2","statuses":"^1.3.1","strip-bom":"^2.0.0","strip-indent":"^1.0.1","stringset":"^0.2.1","strip-ansi":"^3.0.1","strip-json-comments":"^1.0.4","styled_string":"^0.0.1","supports-color":"^0.2.0","symlink-or-copy":"^1.1.6","tap-parser":"^5.4.0","text-extensions":"^1.3.3","tempfile":"^1.1.1","textextensions":"^2.0.1","to-array":"^0.1.4","tmp":"^0.0.28","through2":"^2.0.1","through":"^2.3.8","to-fast-properties":"^1.0.2","trim-off-newlines":"^1.0.1","trim-newlines":"^1.0.0","trim-right":"^1.0.1","try-resolve":"^1.0.1","tryor":"^0.1.2","uglify-to-browserify":"^1.0.2","type-is":"^1.6.13","uglify-js":"^2.7.4","underscore":"^1.8.3","unpipe":"^1.0.0","user-home":"^1.1.1","ultron":"^1.0.2","underscore.string":"^2.3.3","utils-merge":"^1.0.0","uuid":"^2.0.3","util-deprecate":"^1.0.2","validate-npm-package-license":"^3.0.1","walk-sync":"^0.3.1","vary":"^1.1.0","wide-align":"^1.1.3","window-size":"^0.1.0","which":"^1.3.1","wordwrap":"^0.0.3","ws":"^1.1.1","wtf-8":"^1.0.0","xmldom":"^0.1.22","xmlhttprequest-ssl":"^1.5.3","wrappy":"^1.0.2","yallist":"^2.1.2","y18n":"^3.2.1","xtend":"^4.0.1","yeast":"^0.1.2","yargs":"^3.10.0"},"gitHead":"570f856cdb7449a99ad3cd53be8cc1e346577f75","_id":"@boundless-inc/mobiledoc-dom-renderer@0.6.5","_npmVersion":"5.6.0","_nodeVersion":"8.11.3","_npmUser":{"name":"scudco","email":"adamandersonis@gmail.com"},"dist":{"integrity":"sha512-LJHa3gzJu/GVKoxFI7kRhhWKFqx/ublMaOOA6p14UhPsEoWwn/H8kGiLrevuHZ5a08rNyBFnxzCZYyAPjW2ciw==","shasum":"215bd0d735637bd5f26f926f878468d9cc2c4eb7","tarball":"https://registry.npmjs.org/@boundless-inc/mobiledoc-dom-renderer/-/mobiledoc-dom-renderer-0.6.5.tgz","fileCount":40,"unpackedSize":503654,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbM7KoCRA9TVsSAnZWagAA3osP/im+AIjDZExSe0SP6auJ\nXpgNg+jIgz/hpjXshRdtjWpxFE1dY/W2gkzNxCr4P0l2ZOJvE9cB52nXS6YV\nEujGR/OQP80h3YsWuxI+BcoUZuRxke+ku4xTdB3wjIHKT0qiCEJ4h5FFNv26\nKsQYpDyeO0MRgisHbLea5XbMFqrMKiG/VG64V3TWjP4UhqMYAfXRoTiS+ePq\ngbUXHvlYMNLc4ljXYImI00PN5L9/B6XrxPB2+AcryR5PgkV6pLgVNBjJmM9W\nErRZVtmJzWAkyDu1sVcovLvM9vBIvuicyoE4gdRggjQ0xE5qNXwBtP3KvajV\nJKSRJBrCpK+k9Qoo/GQCw4nKFRtUHdyCezfUExzZLtESkobaA+zpOCKp1vpt\n1VwZ186ezxdGQRzLn+inXRXHBxGJ3kbL1OYYZOqh4AnG8XDBCorbN/C9Nnwi\nMRJfgGhxFKCTwJ8FLNvwGLT2XR0z/otwP+6rl6Zvs7/yphZmnNDz4nK1iw2H\nvZ4ZrYOFGTRGlvmmpMcLXeoczcepfo4LsQsa0Y3ugmUbRsZIBNxnOant6i44\nWkXtRGSR0vA6ODw5qMccjLPfjVbF0DjpBj00R06lCCcCXQHvBupdR+GdE9f4\niYISZNt7yo7hkaKbSJiaDTLS0mPmaXad9P1OUdVnti695gNJoOyyDdvNL1lp\nJTeh\r\n=0I43\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDeRfqLBCHVRm+zL8jT8CyfejopxIh1jgG00z17kaG/LQIgA64z80J9GYDs7rvizT8mwEL0xRrbS7DKj1n2i+UW29k="}]},"maintainers":[{"name":"scudco","email":"adamandersonis@gmail.com"},{"name":"sdhull","email":"p.witty@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mobiledoc-dom-renderer_0.6.5_1530114728130_0.6068733125024641"},"_hasShrinkwrap":false}},"time":{"created":"2018-06-27T15:52:08.012Z","0.6.5":"2018-06-27T15:52:08.240Z","modified":"2022-04-04T20:16:02.383Z"},"maintainers":[{"email":"nolane@gmail.com","name":"nolman"},{"email":"adamandersonis@gmail.com","name":"scudco"},{"email":"p.witty@gmail.com","name":"sdhull"}],"description":"Renders Mobiledoc input to DOM output","homepage":"https://github.com/boundless-inc/mobiledoc-dom-renderer","keywords":["mobiledoc","mobiledoc-renderer","content-kit"],"repository":{"type":"git","url":"git+https://github.com/boundless-inc/mobiledoc-dom-renderer.git"},"author":{"name":"Cory Forsyth","email":"cory.forsyth@gmail.com","url":"http://coryforsyth.com/"},"bugs":{"url":"https://github.com/boundless-inc/mobiledoc-dom-renderer/issues"},"license":"MIT","readme":"## Mobiledoc DOM Renderer [![Build Status](https://travis-ci.org/bustlelabs/mobiledoc-dom-renderer.svg?branch=master)](https://travis-ci.org/bustlelabs/mobiledoc-dom-renderer)\n\nThis is a DOM renderer for the [Mobiledoc format](https://github.com/bustlelabs/mobiledoc-kit/blob/master/MOBILEDOC.md) used\nby [Mobiledoc-Kit](https://github.com/bustlelabs/mobiledoc-kit).\n\nTo learn more about Mobiledoc cards and renderers, see the **[Mobiledoc Cards docs](https://github.com/bustlelabs/mobiledoc-kit/blob/master/CARDS.md)**.\n\nThe renderer is a small library intended for use in browser clients.\n\n### Usage\n\n```js\nvar mobiledoc = {\n  version: \"0.3.0\",\n  markups: [\"B\"],\n  atoms: [],\n  cards: [],\n  sections: [\n    [1, 'P', [ // array of markers\n      // marker\n      [ 0,            // marker type 0 (standard text)\n        [0],          // open markups (by index)\n        0,            // close count\n        'hello world'\n      ]\n    ]\n  ]\n};\nvar renderer = new MobiledocDOMRenderer({cards: []});\nvar rendered = renderer.render(mobiledoc);\nvar result = rendered.result;\ndocument.getElementById('output').appendChild(result);\n// renders <div><p><b>hello world</b></b></div>\n// into 'output' element\n```\n\nThe Renderer constructor accepts a single object with the following optional properties:\n\n  * `cards` [array] - The list of card objects that the renderer may encounter in the mobiledoc\n  * `atoms` [array] - The list of atom objects that the renderer may encounter in the mobiledoc\n  * `cardOptions` [object] - Options to pass to cards and atoms when they are rendered\n  * `unknownCardHandler` [function] - Will be called when any unknown card is enountered\n  * `unknownAtomHandler` [function] - Will be called when any unknown atom is enountered\n  * `sectionElementRenderer` [object] - A map of hooks for section element rendering.\n    * Valid keys are P, H1, H2, H3, H4, H5, H6, BLOCKQUOTE, ASIDE\n    * Arguments are `tagName, dom`\n    * A valid value is a function that returns an element\n  * `markupElementRenderer` [object] - A map of hooks for inline element rendering.\n    * Valid keys are B, I, STRONG, EM, A, U, SUB, SUP, S, CODE\n    * Arguments are `tagName, dom, attributes={}`\n    * A valid value is a function that returns an element\n  * `dom` [object] - A native or [SimpleDOM](https://github.com/krisselden/simple-dom)\n    implementation of the DOM.\n\nThe return value from `renderer.render(mobiledoc)` is an object with two properties:\n  * `result` [DOM Node] - The rendered result\n  * `teardown` [function] - When called, this function will tear down the rendered mobiledoc and call any teardown handlers that were registered by cards when they were rendered\n\n#### Rendering HTML\n\nIn a browser, rendering to HTML is simple:\n\n```js\nvar renderer = new MobiledocDOMRenderer();\nvar rendered = renderer.render(mobiledoc);\nvar html = rendered.result.outerHTML;\n```\n\nHowever on the server in Node.js, native DOM APIs are not available. To make\nserver-rendering easy, this DOM\nrenderer is [SimpleDOM](https://github.com/krisselden/simple-dom)\ncompatible. You may pass an instance of a SimpleDOM document and serialize\nits output. For example:\n\n```js\nvar renderer = new MobiledocDOMRenderer({\n  dom: new SimpleDOM.Document()\n});\nvar rendered = renderer.render(mobiledoc);\nvar serializer = new SimpleDOM.HTMLSerializer([]);\nvar html = serializer.serializeChildren(rendered.result);\n```\n\nThis usage of the DOM renderer for rendering HTML has the advantage of allowing\ndevelopers to easily implement cards that work in a server and client context.\n\n#### sectionElementRenderer\n\nUse this renderer option to customize what element is used when rendering\na section.\n\n```\nvar renderer = new MobiledocDOMRenderer({\n  sectionElementRenderer: {\n    P: function(_, dom) { return dom.createElement('span'); },\n    H1: function(_, dom) { return dom.createElement('h2'); },\n    H2: function(tagName, dom) {\n      var element = dom.createElement(tagName);\n      element.setAttribute('class', 'subheadline');\n      return element;\n    }\n    /* Valid keys are P, H1, H2, H3, H4, H5, H6, BLOCKQUOTE, ASIDE */\n  }\n});\nvar rendered = renderer.render(mobiledoc);\n```\n\n#### markupElementRenderer\n\nUse this renderer option to customize what inline tags are used when rendering\na section's content.\n\n```\nvar renderer = new MobiledocDOMRenderer({\n  markupElementRenderer: {\n    B: function(_, dom) { return dom.createElement('strong'); },\n    A: function(tagName, dom, attrs={}) {\n      let element = dom.createElement(tagName);\n\n      for (let attr in attrs) {\n        element.setAttribute(attr, attrs[attr]);\n      }\n\n      element.setAttribute('rel', 'nofollow');\n      return element;\n    }\n  }\n});\nvar rendered = renderer.render(mobiledoc);\n```\n\n#### Attribute Sanitization (XSS Protection)\n\nMobiledoc DOM Renderer sanitizes the `href` attribute of 'A' markups, prefixing\nthe string `unsafe:` on potentially unsafe urls. It determines an environment-\nappropriate URL protocol parser. In rare cases it may be unable to determine one\n(this can happen when running the renderer in a Node VM Sandbox, like ember-cli-\nfastboot does), and will throw in that case. To fix this, you can provide a\ncustom markupElementRenderer for the 'A' tag that will be used instead of the\ndefault.\n\n### Tests\n\n * To run tests via testem: `npm test`\n * To run tests in the browser: `npm start` and open http://localhost:4200/tests\n\n### Releasing\n\n* Use `np` (install with `npm install -g np`)\n* `np <version>` (e.g. `np 0.5.2`)\n* `git push --tags`\n","readmeFilename":"README.md"}