Add some handy markdown editor features (#32400)

There were some missing features from EasyMDE:

1. H1 - H3 style
2. Auto add task list
3. Insert a table

And added some tests
This commit is contained in:
wxiaoguang 2024-11-04 18:14:36 +08:00 committed by GitHub
parent 54146e62c0
commit af28ce59b8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 138 additions and 22 deletions

View file

@ -11,7 +11,7 @@ type TippyOpts = {
const visibleInstances = new Set<Instance>();
const arrowSvg = `<svg width="16" height="7"><path d="m0 7 8-7 8 7Z" class="tippy-svg-arrow-outer"/><path d="m0 8 8-7 8 7Z" class="tippy-svg-arrow-inner"/></svg>`;
export function createTippy(target: Element, opts: TippyOpts = {}) {
export function createTippy(target: Element, opts: TippyOpts = {}): Instance {
// the callback functions should be destructured from opts,
// because we should use our own wrapper functions to handle them, do not let the user override them
const {onHide, onShow, onDestroy, role, theme, arrow, ...other} = opts;