{"id":13758252,"url":"https://github.com/icelab/draft-js-block-breakout-plugin","last_synced_at":"2025-12-14T21:50:57.082Z","repository":{"id":57215923,"uuid":"60672465","full_name":"icelab/draft-js-block-breakout-plugin","owner":"icelab","description":"A plugin for draft-js that allows you to break out of block types as you type.","archived":false,"fork":false,"pushed_at":"2018-10-10T12:25:03.000Z","size":22,"stargazers_count":40,"open_issues_count":2,"forks_count":10,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-01T12:25:37.228Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/icelab.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-06-08T05:59:15.000Z","updated_at":"2024-04-11T21:17:07.000Z","dependencies_parsed_at":"2022-08-26T13:31:44.779Z","dependency_job_id":null,"html_url":"https://github.com/icelab/draft-js-block-breakout-plugin","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icelab%2Fdraft-js-block-breakout-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icelab%2Fdraft-js-block-breakout-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icelab%2Fdraft-js-block-breakout-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icelab%2Fdraft-js-block-breakout-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/icelab","download_url":"https://codeload.github.com/icelab/draft-js-block-breakout-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253379459,"owners_count":21899258,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":"2024-08-03T13:00:23.073Z","updated_at":"2025-12-14T21:50:57.020Z","avatar_url":"https://github.com/icelab.png","language":"JavaScript","funding_links":[],"categories":["Plugins and Decorators Built for Draft.js"],"sub_categories":[],"readme":"# Draft.js Block Breakout plugin\n\n*This is a plugin for the [`draft-js-plugins-editor`](https://www.draft-js-plugins.com/), a plugin system that sits on top of Draft.js.*\n\nBy default draft carries the current block type over to the next line when you press return, which is an undesired behaviour for _some_ of the default block types (headers mostly).\n\nThis plugin adds behaviour to the editor to \"break out\" of certain block types if the user presses `return` at the start or end of the block. Where \"break out\" means changing the inserted block to the default type (usually `unstyled`)\n\n## Usage\n\n```js\nimport createBlockBreakoutPlugin from 'draft-js-block-breakout-plugin'\nconst blockBreakoutPlugin = createBlockBreakoutPlugin()\n```\n\nThis can then be passed into a `draft-js-plugins-editor` component:\n\n```js\nimport createBlockBreakoutPlugin from 'draft-js-block-breakout-plugin'\nconst blockBreakoutPlugin = createBlockBreakoutPlugin()\nimport Editor from 'draft-js-plugins-editor'\n\nconst plugins = [blockBreakoutPlugin]\n\n\u003cEditor plugins={plugins} /\u003e\n```\n\n## Options\n\nYou can pass options to the plugin as you call it:\n\n```js\nconst options = {\n  breakoutBlockType: 'unordered-list-item',\n  breakoutBlocks: ['header-one', 'header-two']\n}\nconst blockBreakoutPlugin = createBlockBreakoutPlugin(options)\n```\n\nThe options and their defaults are:\n\n| Option | Type | Description | Default |\n| --- | --- | --- | --- |\n| `breakoutBlockType` | `String` | Block type to insert when breaking out | `'unstyled'`\n| `breakoutBlocks` | `Array` | List of block types to break out from | `['header-one', 'header-two', 'header-three', 'header-four', 'header-five', 'header-six']`\n| `doubleBreakoutBlocks` | `Array` | List of block types to that require return on a blank line in order to break | `['blockquote', 'unordered-list-item', 'ordered-list-item', 'code-block']`\n\n## Developing\n\n```\nnpm install\nnpm run test\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ficelab%2Fdraft-js-block-breakout-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ficelab%2Fdraft-js-block-breakout-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ficelab%2Fdraft-js-block-breakout-plugin/lists"}