fix: Table rendering

This commit is contained in:
yashsinghcodes
2024-06-07 06:55:21 +00:00
parent f2d99c6091
commit ceca675140
2 changed files with 8 additions and 10 deletions
+2 -4
View File
@@ -18,11 +18,9 @@ code {
margin-right: -13px; margin-right: -13px;
} }
.toc:hover { table th, table td {
background-color: gray; border: 1px solid;
color: white;
} }
/* .cm-string{ /* .cm-string{
z-index: -1; z-index: -1;
} }
+6 -6
View File
@@ -1,15 +1,13 @@
import React, { useEffect, useLayoutEffect, useRef, useState } from "react" import React, { useEffect, useLayoutEffect, useRef, useState } from "react"
import { toast } from 'react-toastify'; import { toast } from 'react-toastify';
import Markdown from 'react-markdown' import Markdown from 'react-markdown'
import theme from '../theme.jsx'; import theme from '../theme.jsx';
import ReactJson from "react-json-view"; import ReactJson from "react-json-view";
import { isMobile } from "react-device-detect"; import { isMobile } from "react-device-detect";
import { BrowserView, MobileView } from "react-device-detect"; import { BrowserView, MobileView } from "react-device-detect";
import { useParams, useNavigate, Link } from "react-router-dom"; import { useParams, useNavigate, Link } from "react-router-dom";
import { validateJson, GetIconInfo } from "../views/Workflows.jsx"; import { validateJson, GetIconInfo } from "../views/Workflows.jsx";
import remarkGfm from 'remark-gfm'
import { import {
Grid, Grid,
TextField, TextField,
@@ -26,7 +24,6 @@ import {
ListItemButton, ListItemButton,
ListItemText ListItemText
} from "@mui/material"; } from "@mui/material";
import { import {
Link as LinkIcon, Link as LinkIcon,
Edit as EditIcon, Edit as EditIcon,
@@ -36,6 +33,7 @@ import {
} from "@mui/icons-material"; } from "@mui/icons-material";
import { fontGrid } from "@mui/material/styles/cssUtils.js"; import { fontGrid } from "@mui/material/styles/cssUtils.js";
import { active } from "d3"; import { active } from "d3";
import style from "./../index.css";
const Body = { const Body = {
//maxWidth: 1000, //maxWidth: 1000,
@@ -158,6 +156,7 @@ export const Img = (props) => {
return <img style={{ borderRadius: theme.palette.borderRadius, width: 750, maxWidth: "100%", marginTop: 15, marginBottom: 15, }} alt={props.alt} src={props.src} />; return <img style={{ borderRadius: theme.palette.borderRadius, width: 750, maxWidth: "100%", marginTop: 15, marginBottom: 15, }} alt={props.alt} src={props.src} />;
} }
export const CodeHandler = (props) => { export const CodeHandler = (props) => {
const propvalue = props.value !== undefined && props.value !== null ? props.value : props.children !== undefined && props.children !== null && props.children.length > 0 ? props.children[0] : "" const propvalue = props.value !== undefined && props.value !== null ? props.value : props.children !== undefined && props.children !== null && props.children.length > 0 ? props.children[0] : ""
@@ -369,8 +368,7 @@ const Docs = (defaultprops) => {
hash = hash.split('?')[0] hash = hash.split('?')[0]
} }
if (hash) { if (hash) {
console.log("HASH: ", hash) const element = document.getElementById(hash.toLowerCase())
const element = document.getElementById(hash)
if (element) { if (element) {
element.scrollIntoView({ element.scrollIntoView({
behavior: "instant", behavior: "instant",
@@ -1022,8 +1020,10 @@ const Docs = (defaultprops) => {
<Markdown <Markdown
components={markdownComponents} components={markdownComponents}
id="markdown_wrapper" id="markdown_wrapper"
className={"style.reactMarkdown"}
escapeHtml={false} escapeHtml={false}
skipHtml={false} skipHtml={false}
remarkPlugins={[remarkGfm]}
style={{ style={{
maxWidth: "100%", minWidth: "100%", maxWidth: "100%", minWidth: "100%",
}} }}