Skip to content

Commit

Permalink
fix: Fixed children wasn't string
Browse files Browse the repository at this point in the history
  • Loading branch information
MahdiyarGHD committed Jul 3, 2024
1 parent 2d35a44 commit f993a6e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<meta name="keyword" content="چیت‌شیت,چیت شیت,راهنما, لاراول,laravel,laravel guide,برگه تقلب,cheat sheet, laravel cheatsheet">
<meta property="og:type" content="website">
<meta property="og:image" content="/favicon.ico">
<script type="module" crossorigin src="/assets/index-DDXOjVhH.js"></script>
<script type="module" crossorigin src="/assets/index-DB6UUXt7.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-Bnm5Wat6.css">
</head>
<body>
Expand Down
6 changes: 3 additions & 3 deletions src/components/Codeblock.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import '../lib/highlightjs/styles/github-dark.min.css';
import php from 'highlight.js/lib/languages/php';
import { isNullOrEmpty } from '../lib/utils';

const Codeblock = ({ hasHighlight = true, language = '', isLineNumberDisabled = false, children = 'hey' }) => {
const Codeblock = ({ hasHighlight = true, language = '', isLineNumberDisabled = false, children}) => {
if (hasHighlight === false)
return (<span className='font-[monospace]'>{children}</span>)

if (!isNullOrEmpty(children))
children = children.replace(/^\s*[\r\n]+|[\r\n]+\s*$/g, '').replace(/^[ \t]+/gm, '');
if (!isNullOrEmpty(children.toString()))
children = children.toString().replace(/^\s*[\r\n]+|[\r\n]+\s*$/g, '').replace(/^[ \t]+/gm, '');

const codeRef = useRef(null);

Expand Down

0 comments on commit f993a6e

Please sign in to comment.