Okay, I found out from there that this is what I need https://getpublii.com/dev/post-editor-api/#customformats but it simply doesn’t work for me. I might have done something wrong but idk what. Here’s what I’ve done.
#1 In Documents\Publii\themes\technews i opened config.json file and added this code https://prnt.sc/8hi2dJEPlr9h
#2 After I saved config.json file, I opened my theme’s root directory (Documents\Publii\themes\technews) and created the following two files: tinymce.override.json and customElements.json
#3 The content of tinymce.override.json:
{
"toolbar2": "customElements nonbreaking styleselect formatselect searchreplace hr readmore removeformat undo redo restoredraft sourcecode ",
"plugins": "nonbreaking advlist autolink autosave link image lists hr pagebreak searchreplace media table paste autoresize emoticons textpattern toc"
}
#4 The content of customElements.json:
"customElements": [
{
"label": "Cvars",
"cssClasses": "msg msg--cvars",
"selector": "p"
"postEditor": true,
"themeSettings": true
},
{
"label": "Commands",
"cssClasses": "msg msg--cmds",
"selector": "p"
"postEditor": true,
"themeSettings": false
},
{
"label": "Warning",
"cssClasses": "msg msg--warning",
"selector": "p"
"postEditor": true,
"themeSettings": false
}
]
#5 I also added CSS classes for those formats in Documents\Publii\themes\technews\assets\css\editor.css file.
And I still don’t have new custom formats added in my editor when writing the post. Where did I made a mistake?