react-medium-editor icon indicating copy to clipboard operation
react-medium-editor copied to clipboard

Example for integrating existing medium-editor extensions

Open matthiaskrieft opened this issue 9 years ago • 9 comments

I currently don't really know where to start with when trying to use some of the existing medium-editor extensions, e.g. from here: https://github.com/yabwe/medium-editor/wiki/extensions-plugins together with the react-medium-editor component.

Does anyone have a snippet that I could base on?

matthiaskrieft avatar Apr 06 '16 14:04 matthiaskrieft

+1

zhaoyao91 avatar Apr 07 '16 09:04 zhaoyao91

+1

wawrzynkiewicz avatar Apr 07 '16 10:04 wawrzynkiewicz

+1

oachoor avatar Apr 07 '16 10:04 oachoor

+1

schroeder avatar Apr 07 '16 10:04 schroeder

+1

ditorahard avatar May 26 '16 17:05 ditorahard

@matthiaskrieft: Did you ever find this out?

poacher2k avatar Nov 18 '16 09:11 poacher2k

@poacher2k No, but we'll move on to sTh draft-js based.

matthiaskrieft avatar Nov 18 '16 09:11 matthiaskrieft

Heres what i did

import AutoList from 'medium-editor-autolist/dist/autolist.js'; // node_modules/medium-editor-autolist...
var autolist = new AutoList();

then in the options prop for the editor { extensions: { 'autolist': autolist } }, // autolist is a reference to the variable autolist which contains the Autolist function included from the plugin.

Complete component example:

<Editor
   text={ this.props.text }
   onChange={ this.props.onChange }
   options={
	{ extensions: { 'autolist': autolist } },
	{ placeholder: { text: this.props.placeholder } },
	{ toolbar: { buttons: ['h1', 'h2', 'h3', 'bold', 'italic', 'quote', 'pre', 'unorderedlist', 'orderedlist'] } } 
} />

Hope this helps.

didair avatar Jun 05 '17 12:06 didair

@didair

Hello , I want to customized size images when drag images. Please tell me how to customize images size Please.

Yoottana-Prapbuntarik avatar Nov 06 '20 07:11 Yoottana-Prapbuntarik