Skip to content

Commit

Permalink
Remove markdown "nostyle" table code
Browse files Browse the repository at this point in the history
  • Loading branch information
255kb committed Jan 31, 2025
1 parent 39e3519 commit 1970ac2
Showing 1 changed file with 2 additions and 17 deletions.
19 changes: 2 additions & 17 deletions components/markdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,25 +135,10 @@ const Markdown: FunctionComponent<{
);
},
table: ({ children }) => {
// check if 'NOSTYLE' is present in the header first cell
let noStyle = false;

let firstCell =
children[0]?.props?.children?.props?.children?.[0]?.props?.children;
if (firstCell && firstCell.includes('NOSTYLE')) {
noStyle = true;
}

return (
<div
className={`card p-4 my-6 ${
noStyle ? 'bg-transparent' : 'border shadow-lg'
}`}
>
<div className='card p-4 my-6 border shadow-lg'>
<div className='table-responsive'>
<table className={`table ${noStyle ? 'table-borderless' : ''}`}>
{noStyle ? children[1] : children}
</table>
<table className='table'>{children}</table>
</div>
</div>
);
Expand Down

0 comments on commit 1970ac2

Please sign in to comment.