/
githubmirror
/
marktext
Обзор
Документация
Войти
/
githubmirror
/
marktext
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
packages/muya/src/block/extra/math/mathContainer.ts
45 строк
1 KB
Ran Luo
feat(muya): migrate TS rewrite to packages/muya alongside legacy muyajs (#4314)
29 май 2026, 15:35
Не верифицирован
29 май 2026, 15:35
0d86641
Код
Авторство
О чём код?
import type { Muya } from '../../../muya'; import type { IMathBlockState, TState } from '../../../state/types'; import logger from '../../../utils/logger'; import Parent from '../../base/parent'; import { ScrollPage } from '../../scrollPage'; const debug = logger('mathContainer:'); class MathContainer extends Parent { static override blockName = 'math-container'; static create(muya: Muya, state: IMathBlockState) { const mathContainer = new MathContainer(muya); const code = ScrollPage.loadBlock('code').create(muya, state); mathContainer.append(code); return mathContainer; } get lang() { return 'latex'; } override get path() { const { path: pPath } = this.parent!; return [...pPath]; } constructor(muya: Muya) { super(muya); this.tagName = 'pre'; this.classList = ['mu-math-container']; this.createDomNode(); } override getState(): TState { debug.warn('You can never call `getState` in mathContainer'); return {} as TState; } } export default MathContainer;