{"id":13758269,"url":"https://github.com/dburrows/draft-js-basic-html-editor","last_synced_at":"2025-05-10T07:30:47.900Z","repository":{"id":56703340,"uuid":"52556659","full_name":"dburrows/draft-js-basic-html-editor","owner":"dburrows","description":"Basic HTML editor using draft.js - html in, html out","archived":false,"fork":false,"pushed_at":"2020-10-24T04:10:38.000Z","size":477,"stargazers_count":87,"open_issues_count":9,"forks_count":29,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-06T04:44:34.789Z","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/dburrows.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-02-25T21:04:42.000Z","updated_at":"2024-02-12T23:53:57.000Z","dependencies_parsed_at":"2022-08-15T23:40:19.282Z","dependency_job_id":null,"html_url":"https://github.com/dburrows/draft-js-basic-html-editor","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dburrows%2Fdraft-js-basic-html-editor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dburrows%2Fdraft-js-basic-html-editor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dburrows%2Fdraft-js-basic-html-editor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dburrows%2Fdraft-js-basic-html-editor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dburrows","download_url":"https://codeload.github.com/dburrows/draft-js-basic-html-editor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253379462,"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.855Z","updated_at":"2025-05-10T07:30:47.625Z","avatar_url":"https://github.com/dburrows.png","language":"JavaScript","funding_links":[],"categories":["Plugins and Decorators Built for Draft.js","JavaScript"],"sub_categories":[],"readme":"# draft-js-BasicHtmlEditor\nBasic HTML editor using draft.js - html in, html out\n\nProof of concept currently, not production ready! PR's welcome.\n\nExtends the Rich example from the Draft repo to accept html as its input format, and return html to an `onChange` handler.\n\n### Tag Support\n\nBlock tags: `\u003cp\u003e \u003ch1\u003e \u003ch2\u003e \u003cblockquote\u003e \u003cul\u003e \u003col\u003e \u003ccode\u003e`\n\nInline tags: `\u003cstrong\u003e \u003cem\u003e \u003cu\u003e \u003ccode\u003e \u003cdel\u003e`\n\n### Install\n\n`$ npm install draft-js-basic-html-editor`\n\nNote: You'll also need to install `react` and `react-dom` if you don't already have them\n\n#### Webpack\n\nThe component is built without `react` or `react-dom` so you'll need to make sure that Webpack can resolve copies of both those modules. Either add your projects `node_modules` as fallback path:\n\n```\nresolve: {\n  fallback:  path.resolve('./node_modules')\n}\n\n```\n\nor create an alias for just those 2 modules\n\n```\nresolve: {\n  alias: {\n    'react': path.resolve('./node_modules/react'),\n    'react-dom': path.resolve('./node_modules/react-dom'),\n  }\n```\n\n### Usage \n\n```js\n\nimport BasicHtmlEditor from 'draft-js-basic-html-editor';\n\nconst MyEditor = () =\u003e {\n  const initialHtml = 'hello, \u003cb\u003eWorld\u003c/b\u003e';\n  const onChange = html =\u003e console.log('updated', html);\n\n  return (\n    \u003cBasicHtmlEditor\n      value={ initialHtml }\n      onChange={ onChange }\n      debounce={ 500 }\n    /\u003e\n  )\n}\n```\n\n### Demo\n\nhttp://dburrows.github.io/draft-js-basic-html-editor/example-dist/\n\n#### Development\n\n    $ npm install\n    $ webpack-dev-server\n\n#### To Do\n\n* Block support ✔️\n* Inline tag support ✔️\n* Handle Lists with more than one element ✔️\n* Tests ✔️\n* Links ✔️\n* Images\n* Prod build ✔️\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdburrows%2Fdraft-js-basic-html-editor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdburrows%2Fdraft-js-basic-html-editor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdburrows%2Fdraft-js-basic-html-editor/lists"}