Closed joelm10 closed 3 years ago
Have you tried adding getTextAlignClassName
with getTextAlignStyles
to the editor? That worked for me
@mcbroh as a prop being passed into the Editor or another approach? Can you elaborate on this, as they appeared to be internal methods - https://github.com/sstur/react-rte/blob/master/src/EditorDemo.js#L7- , not props to be passed in?
The documentation does not explain so much about props and co, but I had to actually check the node module code to see what is been exposed or not.
import RichTextEditor, {getTextAlignClassName, getTextAlignStyles, getTextAlignBlockMetadata} from 'react-rte';
......
value.toString('html', {blockStyleFn: getTextAlignStyles})
To get the styles.
......
<RichTextEditor ...... blockStyleFn={getTextAlignClassName} />
To enable the styles
That works for me with no errors. But there is still a bigger problem which is getting styled value from a server or where ever into the text editor.
thanks, this works great @mcbroh appreciate your help/feedback 👍
Installed via npm i
Effected versions: v0.16.3, 0.16.2, 0.16.1
Browser: Chrome: Version 86.0.4240.75 (Official Build) (x86_64)
To replicate:
Sample code: