MCPcopy Create free account
hub / github.com/QasimWani/LeetHub / parseCode

Function parseCode

scripts/leetcode.js:372–384  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

370
371/* Main parser function for the code */
372function parseCode() {
373 const e = document.getElementsByClassName('CodeMirror-code');
374 if (e !== undefined && e.length > 0) {
375 const elem = e[0];
376 let parsedCode = '';
377 const textArr = elem.innerText.split('\n');
378 for (let i = 1; i < textArr.length; i += 2) {
379 parsedCode += `${textArr[i]}\n`;
380 }
381 return parsedCode;
382 }
383 return null;
384}
385
386/* Util function to check if an element exists */
387function checkElem(elem) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected