Skip to content
This repository has been archived by the owner on Feb 6, 2023. It is now read-only.

Commit

Permalink
Add Section and Article to DefaultBlockRenderMap (#2212)
Browse files Browse the repository at this point in the history
Summary:
*Before* submitting a pull request, please make sure the following is done...

1. Fork the repo and create your branch from `master`.
2. If you've added code that should be tested, add tests!
3. If you've changed APIs, update the documentation.
4. Ensure that:
  * The test suite passes (`npm test`)
  * Your code lints (`npm run lint`) and passes Flow (`npm run flow`)
  * You have followed the [testing guidelines](https://github.com/facebook/draft-js/wiki/Testing-for-Pull-Requests)
5. If you haven't already, complete the [CLA](https://code.facebook.com/cla).

Please use the simple form below as a guideline for describing your pull request.

Thanks for contributing to Draft.js!

-

**Summary**

Fixes #2074
Updated the default block render map to have the section and article tags.
Pull Request resolved: #2212

Reviewed By: claudiopro

Differential Revision: D18246366

Pulled By: mrkev

fbshipit-source-id: 144f7721d92d6efcbb5c969ba992841eb9bd5f15
  • Loading branch information
Tarun047 authored and facebook-github-bot committed Dec 17, 2019
1 parent 6fc9964 commit e20f79f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/model/constants/DraftBlockType.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ export type CoreDraftBlockType =
| 'ordered-list-item'
| 'blockquote'
| 'code-block'
| 'atomic';
| 'atomic'
| 'section'
| 'article';

/**
* User defined types can be of any valid string.
Expand Down
6 changes: 6 additions & 0 deletions src/model/immutable/DefaultDraftBlockRenderMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ const DefaultDraftBlockRenderMap: DefaultCoreDraftBlockRenderMap = Map({
'header-six': {
element: 'h6',
},
section: {
element: 'section',
},
article: {
element: 'article',
},
'unordered-list-item': {
element: 'li',
wrapper: UL_WRAP,
Expand Down

0 comments on commit e20f79f

Please sign in to comment.