diff --git a/package-lock.json b/package-lock.json index adf45b8ea..2d194f7ab 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "1.1.3", + "version": "1.1.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "1.1.3", + "version": "1.1.4", "license": "ISC", "dependencies": { "@types/react-dates": "^21.8.6", @@ -66,7 +66,7 @@ "@rjsf/validator-ajv8": "^5.13.3", "@typeform/embed-react": "2.20.0", "dompurify": "^3.0.2", - "marked": "4.3.0", + "marked": "^13.0.3", "react": "^17.0.2", "react-dom": "^17.0.2", "react-draggable": "^4.4.5", @@ -7309,15 +7309,16 @@ } }, "node_modules/marked": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/marked/-/marked-4.3.0.tgz", - "integrity": "sha512-PRsaiG84bK+AMvxziE/lCFss8juXjNaWzVbN5tXAm4XjeaS9NAHhop+PjQxz2A9h8Q4M/xGmzP8vqNwy6JeK0A==", + "version": "13.0.3", + "resolved": "https://registry.npmjs.org/marked/-/marked-13.0.3.tgz", + "integrity": "sha512-rqRix3/TWzE9rIoFGIn8JmsVfhiuC8VIQ8IdX5TfzmeBucdY05/0UlzKaw0eVtpcN/OdVFpBk7CjKGo9iHJ/zA==", + "license": "MIT", "peer": true, "bin": { "marked": "bin/marked.js" }, "engines": { - "node": ">= 12" + "node": ">= 18" } }, "node_modules/memoize-one": { diff --git a/package.json b/package.json index 9704480bd..ab1cbfc70 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "1.1.3", + "version": "1.1.4", "description": "Supporting common component library", "type": "module", "main": "dist/index.js", @@ -79,7 +79,7 @@ "@rjsf/validator-ajv8": "^5.13.3", "@typeform/embed-react": "2.20.0", "dompurify": "^3.0.2", - "marked": "4.3.0", + "marked": "^13.0.3", "react": "^17.0.2", "react-dom": "^17.0.2", "react-draggable": "^4.4.5", diff --git a/src/Common/Markdown/MarkDown.tsx b/src/Common/Markdown/MarkDown.tsx index 624b797f4..251d8b9b8 100644 --- a/src/Common/Markdown/MarkDown.tsx +++ b/src/Common/Markdown/MarkDown.tsx @@ -14,14 +14,12 @@ * limitations under the License. */ -import { marked } from 'marked' +import { marked, Tokens } from 'marked' import DOMPurify from 'dompurify' import { useEffect, useRef } from 'react' import { MarkDownProps } from './Types' import './markdown.scss' -const uncheckedCheckboxInputElement = `` -const checkedCheckboxInputElement = `` const renderer = new marked.Renderer() const MarkDown = ({ setExpandableIcon, markdown, className, breaks, disableEscapedText, ...props }: MarkDownProps) => { @@ -39,62 +37,59 @@ const MarkDown = ({ setExpandableIcon, markdown, className, breaks, disableEscap getHeight() }, [markdown]) - const isReadmeInputCheckbox = (text: string) => { - if (text.includes(uncheckedCheckboxInputElement) || text.includes(checkedCheckboxInputElement)) { - return true - } - return false - } + const renderTableRow = (row: Tokens.TableCell[]) => ` +
${headerCell.text} | `).join('')}
---|