core
core copied to clipboard
Support WYSIWYG text editor
Describe the feature
Can tinymce be supported so as it goes smoothly with cogentcore forms?
See
- https://www.tiny.cloud/docs/tinymce/latest/npm-projects/#initialize-tinymce-as-part-of-a-web-form
- https://www.tiny.cloud/blog/source-code-editing/
Basically the web page source should looks something like this:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="/path/or/uri/to/tinymce.min.js" referrerpolicy="origin"></script>
<script>
tinymce.init({
selector: '#mytextarea',
plugins: 'powerpaste casechange searchreplace autolink directionality visualblocks visualchars image link media mediaembed codesample table charmap pagebreak nonbreaking anchor tableofcontents insertdatetime advlist lists checklist wordcount tinymcespellchecker editimage help formatpainter permanentpen charmap linkchecker emoticons advtable export autosave',
toolbar: 'undo redo print spellcheckdialog formatpainter | blocks fontfamily fontsize | bold italic underline forecolor backcolor | link image | alignleft aligncenter alignright alignjustify',
license_key: 'gpl|<your-license-key>'
});
</script>
</head>
<body>
<h1>TinyMCE Quick Start Guide</h1>
<form method="post">
<textarea id="mytextarea">Hello, World!</textarea>
</form>
</body>
</html>
I guess the answer would be "yes", but I'd appreciate a more hands-on example. thanks!
Relevant code
No response
Unfortunately, the way Cogent Core is structured, it is not compatible with other JS libraries that control widgets such as tinymce. However, we could add similar functionality to Cogent Core itself at some point.