Наличие редактора response wysiwyg, определенного как:
function getDefaultState() {
const blocksFromHtml = htmlToDraft('');
const {contentBlocks, entityMap} = blocksFromHtml;
const contentState = ContentState.createFromBlockArray(contentBlocks, entityMap);
const editorState = EditorState.createWithContent(contentState);
return editorState;
}
export default function WysiwygComponent() {
const [state, setState] = useState({
editorState: getDefaultState(),
html: '',
});
const onEditorStateChange = (tempContent) => {
console.log('Content was updated:', tempContent);
let rawContent = convertToRaw(tempContent.getCurrentContent());
let html = draftToHtml(rawContent);
setState({
...state,
html: html,
editorState: tempContent
});
};
return (
<Editor
editorState={state.editorState}
editorClassName={classes.textStyle}
onEditorStateChange={onEditorStateChange}/>
)
}
Производит вывод, как показано на изображении. введите описание изображения здесь
Как я могу ограничить выбор шрифта, чтобы он содержал только шрифт Roboto, или чтобы вообще убрать выбор шрифта и установить Roboto в качестве шрифта по умолчанию?
Спасибо!