Download spectrum/shared/clients/draft-js/utils/plaintext.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 232 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/spectrum/shared/clients/draft-js/utils/plaintext.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/spectrum/shared/clients/draft-js/utils/plaintext.js
-
curl -L -o plaintext.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/spectrum/shared/clients/draft-js/utils/plaintext.js
232 Bytes
| // @flow | |
| import type { RawContentState } from 'draft-js'; | |
| export const toPlainText = (raw: RawContentState) => { | |
| return raw.blocks | |
| .filter(block => block.type === 'unstyled') | |
| .map(block => block.text) | |
| .join('\n'); | |
| }; | |