Skip to content

Commit 7a3508e

Browse files
committed
added: jsdocs comments, removed: redundant plugins
1 parent 448135c commit 7a3508e

File tree

3 files changed

+15
-23
lines changed

3 files changed

+15
-23
lines changed

stories/Configure.mdx

Lines changed: 0 additions & 11 deletions
This file was deleted.

stories/MarkdownEditor.jsx

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ const parser = (htmlCode) => {
1717
return HtmlToMarkdown.turndown(htmlCode);
1818
};
1919

20+
/**
21+
* This Markdown editor is implemented using TinyMCE and Supercode.
22+
* Using the `renderer` and `parser` methods TinyMCE can be converted
23+
* into a format Editor for any language. Also note that few tools like
24+
* indentation, text color, alignment has no effect on markdown, so its better to not add them in toolbar.
25+
*/
2026
export default function MarkdownEditor({ skin = 'oxide', initialValue}) {
2127
const editorRef = React.useRef(null);
2228
const [value, setValue] = React.useState(renderer(initialValue)); // the actual value will be HTML. Parse it when needed.
@@ -34,14 +40,13 @@ export default function MarkdownEditor({ skin = 'oxide', initialValue}) {
3440
}}
3541
init={{
3642
plugins: [
37-
'advlist', 'autolink', 'lists', 'link', 'image', 'charmap', 'preview',
38-
'anchor', 'searchreplace', 'visualblocks', 'code', 'fullscreen',
39-
'insertdatetime', 'media', 'table', 'code', 'help', 'supercode'
43+
'autolink', 'lists', 'link', 'anchor', 'searchreplace', 'visualblocks', 'fullscreen',
44+
'table', 'help', 'supercode'
4045
],
4146
toolbar: 'undo redo | blocks | ' +
42-
'bold italic forecolor | alignleft aligncenter ' +
43-
'alignright alignjustify | bullist numlist | ' +
44-
'codeeditor | supercode',
47+
'bold italic underline' +
48+
'| bullist numlist | ' +
49+
'supercode',
4550
skin,
4651
base_url: '/tinymce',
4752
promotion: false,

stories/TinymceEditor.jsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,8 @@ export default function TinymceEditor({ skin = 'oxide', mode, value, size = 'non
3838
const modes = {
3939
"super" : {
4040
plugins: [
41-
'advlist', 'autolink', 'lists', 'link', 'image', 'charmap', 'preview',
42-
'anchor', 'searchreplace', 'visualblocks', 'code', 'fullscreen',
43-
'insertdatetime', 'media', 'table', 'code', 'help', 'supercode'
41+
'advlist', 'autolink', 'lists', 'link', 'anchor',
42+
'searchreplace', 'visualblocks', 'table', 'help', 'supercode'
4443
],
4544
toolbar: 'undo redo | blocks | ' +
4645
'bold italic forecolor | alignleft aligncenter ' +
@@ -49,9 +48,8 @@ export default function TinymceEditor({ skin = 'oxide', mode, value, size = 'non
4948
},
5049
"classic" : {
5150
plugins: [
52-
'advlist', 'autolink', 'lists', 'link', 'image', 'charmap', 'preview',
53-
'anchor', 'searchreplace', 'visualblocks', 'code', 'fullscreen',
54-
'insertdatetime', 'media', 'table', 'code', 'help', 'code'
51+
'advlist', 'autolink', 'lists', 'link', 'anchor',
52+
'searchreplace', 'visualblocks', 'table', 'help', 'code'
5553
],
5654
toolbar: 'undo redo | blocks | ' +
5755
'bold italic forecolor | alignleft aligncenter ' +

0 commit comments

Comments
 (0)