# EditorContext.format(string name, string value)

Start from base library version 2.7.0. Please remaining backward compatible.

with Promise style call: Not supported

Mini Program plugin: Support

Modify Style

# parameter

# string name

attribute

# string value

value

# Style list supporting settings

name value verson
bold 2.7.0
italic 2.7.0
underline 2.7.0
strike 2.7.0
ins 2.7.0
script sub / super 2.7.0
header H1 / H2 / h3 / H4 / h5 / H6 2.7.0
align left / center / right / justify 2.7.0
direction rtl 2.7.0
indent -1 / +1 2.7.0
list ordered / bullet / check 2.7.0
color hex color 2.7.0
backgroundColor hex color 2.7.0
margin/marginTop/marginBottom/marginLeft/marginRight css style 2.7.0
padding/paddingTop/paddingBottom/paddingLeft/paddingRight css style 2.7.0
font/fontSize/fontStyle/fontVariant/fontWeight/fontFamily css style 2.7.0
lineHeight css style 2.7.0
letterSpacing css style 2.7.0
textDecoration css style 2.7.0
textIndent css style 2.8.0
wordWrap css style 2.10.2
wordBreak css style 2.10.2
whiteSpace css style 2.10.2

Selection settings that have already applied styles cancel styles. css style Express css The allowable value specified in.