MCPcopy Create free account
hub / github.com/cweijan/vscode-office / getMathBlockText

Function getMathBlockText

vditor/src/ts/codeBlock/codeMirrorManager.ts:131–138  ·  view source on GitHub ↗
(blockElement: HTMLElement)

Source from the content-addressed store, hash-verified

129};
130
131const getMathBlockText = (blockElement: HTMLElement) => {
132 const binding = bindings.get(blockElement);
133 if (binding) {
134 return binding.view.state.doc.toString();
135 }
136 const parts = getBlockParts(blockElement);
137 return parts?.code.textContent ?? "";
138};
139
140export const isMathBlockEmpty = (blockElement: HTMLElement) => {
141 return getMathBlockText(blockElement).trim() === "";

Callers 1

isMathBlockEmptyFunction · 0.85

Calls 3

getBlockPartsFunction · 0.85
getMethod · 0.65
toStringMethod · 0.45

Tested by

no test coverage detected