am-editor11212/docs/plugin/plugin-italic.md

1.1 KiB

@aomao/plugin-italic

Italic style plugin

Installation

$ yarn add @aomao/plugin-italic

Add to engine

import Engine, {EngineInterface} from'@aomao/engine';
import Italic from'@aomao/plugin-italic';

new Engine(...,{ plugins:[Italic] })

Optional

hot key

The default shortcut key is mod+i, and multiple shortcut keys are passed in as an array

//hot key,
hotkey?: string | Array<string>;

//Use configuration
new Engine(...,{
    config:{
        "italic":{
            //Modify shortcut keys
            hotkey: "shortcut key"
        }
    }
 })

Markdown

Support markdown by default, pass in false to close

Italic plugin markdown syntax is _

markdown?: boolean;//enabled by default, false off
//Use configuration
new Engine(...,{
    config:{
        "italic":{
            //Close markdown
            markdown:false
        }
    }
 })

Command

engine.command.execute('italic');
//Use command to execute query current status, return boolean | undefined
engine.command.queryState('italic');