Skip to content

Commit

Permalink
Merge pull request #13 from perimetre/1.3
Browse files Browse the repository at this point in the history
1.3
  • Loading branch information
adarleyjrr authored Mar 2, 2021
2 parents be99d52 + 5d95652 commit 673022b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

## [1.3.0] - 2021-03-02

### Added

- Added `getPlainText` method to `useImperativeHandle` hook in WYSIWYGInput component

## [1.2.0] - 2021-03-01

### Added
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@perimetre/ui",
"description": "A component library made by @perimetre",
"version": "1.2.0",
"version": "1.3.0",
"repository": {
"type": "git",
"url": "git+https://github.com/perimetre/ui.git"
Expand Down
6 changes: 5 additions & 1 deletion src/components/WYSIWYGInput/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,11 @@ export const WYSIWYGInput = forwardRef<WYSIWYGInputRef, WYSIWYGInputProps>(
// Ref(HTML part at the end): https://jpuri.github.io/react-draft-wysiwyg/#/docs
const htmlData = draftToHtml(convertToRaw(editorState.getCurrentContent()));
return DOMPurify.sanitize(htmlData);
}
},
/**
* Returns a plain text string from the current editor state
*/
getPlainText: () => editorState.getCurrentContent().getPlainText()
}));

const focus = useCallback(() => {
Expand Down

0 comments on commit 673022b

Please sign in to comment.