diff --git a/package.json b/package.json index d33e9087..071c266b 100644 --- a/package.json +++ b/package.json @@ -194,4 +194,4 @@ "webpack": "^4.42.1", "webpack-bundle-analyzer": "^3.7.0" } -} +} \ No newline at end of file diff --git a/src/components/render-html.jsx b/src/components/render-html.jsx index 6097fb25..34c123a9 100644 --- a/src/components/render-html.jsx +++ b/src/components/render-html.jsx @@ -1,30 +1,30 @@ -import React, { useEffect, useRef } from 'react' -import 'katex/dist/katex.min.css'; +import React, { useEffect, useRef } from "react"; +import "katex/dist/katex.min.css"; -import marked, { getTocContent, cleanToc } from '../common/marked' +import marked, { getTocContent, cleanToc } from "../common/marked"; -let preRegex = /
]*>/g
+let preRegex = /]*>/g;
-export default ({ value = '', is_md = true, className, style = {} }) => {
- let str = String(value)
- let html = is_md ? marked(str) : value
+export default ({ value = "", is_md = true, className, style = {} }) => {
+ let str = String(value);
+ let html = is_md ? marked(str) : value;
if (str.match(/\[TOC\]/)) {
- html = html.replace("[TOC]
", getTocContent())
- cleanToc()
+ html = html.replace("[TOC]
", getTocContent());
+ cleanToc();
}
- html = html.replace(/▁/g, "▁▁▁")
- const el = useRef()
+ html = html.replace(/▁/g, "▁▁▁");
+ const el = useRef();
function onAncherHandler(e) {
- let target = e.target
- if (target.tagName.toUpperCase() === 'A') {
- let ancher = target.getAttribute('href')
- if (ancher.startsWith('#')) {
- e.preventDefault()
- let viewEl = document.getElementById(ancher.replace('#', ''))
+ let target = e.target;
+ if (target.tagName.toUpperCase() === "A") {
+ let ancher = target.getAttribute("href");
+ if (ancher.startsWith("#")) {
+ e.preventDefault();
+ let viewEl = document.getElementById(ancher.replace("#", ""));
if (viewEl) {
- viewEl.parentNode.scrollTop = viewEl.offsetTop
+ viewEl.parentNode.scrollTop = viewEl.offsetTop;
}
}
}
@@ -33,16 +33,23 @@ export default ({ value = '', is_md = true, className, style = {} }) => {
useEffect(() => {
if (el.current && html) {
if (html.match(preRegex)) {
- window.PR.prettyPrint()
+ window.PR.prettyPrint();
}
}
if (el.current) {
- el.current.addEventListener('click', onAncherHandler)
+ el.current.addEventListener("click", onAncherHandler);
return () => {
- el.current.removeEventListener('click', onAncherHandler)
- }
+ el.current.removeEventListener("click", onAncherHandler);
+ };
}
- }, [html, el.current, onAncherHandler])
+ }, [html, el.current, onAncherHandler]);
- return ()
-}
\ No newline at end of file
+ return (
+
+ );
+};
diff --git a/src/forge/css/index.css b/src/forge/css/index.css
index f56357c4..ec8f7412 100644
--- a/src/forge/css/index.css
+++ b/src/forge/css/index.css
@@ -1,3 +1,6 @@
+ul,ol,dl{
+ margin-bottom: 0px!important;
+}
.newMain{
background-color: #fff;
}
diff --git a/src/modules/tpm/challengesnew/tpm-md-editor.js b/src/modules/tpm/challengesnew/tpm-md-editor.js
index 0fa0e1fd..34507ff4 100644
--- a/src/modules/tpm/challengesnew/tpm-md-editor.js
+++ b/src/modules/tpm/challengesnew/tpm-md-editor.js
@@ -252,8 +252,8 @@ export default ({ mdID, onChange, onCMBeforeChange, onCMBlur, error = false, cla
}
}
}, [
- editorInstance, resizeBarEl
- ])
+ editorInstance, resizeBarEl
+ ])
return (