You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
functiontextWithBlanks(text: string): string{//rehype-raw allows the passing of html elements from the json file (when the users set a <p> text for example)//remarkGfm draws markdown tablesconsthtmlString=ReactDOMServer.renderToString(<ReactMarkdownchildren={text}linkTarget='_blank'transformLinkUri={normalizeLinkUri}rehypePlugins={[rehypeRaw,rehypeKatex]}remarkPlugins={[remarkGfm,remarkMath]}/>);//Split the html notes where the input should be insertedconsthtmlStringSplit=htmlString.split("[]");//Insert the input marker between the array elements but not at the endconstres=htmlStringSplit.map((line,index)=>{if(index<htmlStringSplit.length-1){returnline.concat(ReactDOMServer.renderToString(<inputclassName={"input-wrapper"}id={`input-wrapper-${index}`}/>));}else{returnline;}});//Combine the array to one string againconstjoinedElements=res.join("");//Remove jsx specific html syntaxconstexportHTML=joinedElements.replaceAll("<","<").replaceAll(">",">").replaceAll(""",'"').replaceAll('data-reactroot=""',"");// Sanitize the resultreturnDOMPurify.sanitize(exportHTML,{FORBID_TAGS: forbiddenTags,FORBID_ATTR: forbiddenAttributes,});}
Todo:
replace the render in the useLayoutEffect of gap-text and gap-text-dropdown with just attaching events
replace the replaceAll with regex
The text was updated successfully, but these errors were encountered:
GapText.css and GapTextDropdown.css
.question-gap-text p, .correction-gap-text p, .question-gap-text div, .correction-gap-text div, .question-gap-text input, .correction-gap-text input { white-space: pre-wrap; - display: inline; }
The next part somewhat relates to #201
Todo:
The text was updated successfully, but these errors were encountered: