Skip to content

Commit

Permalink
✨ feat: parkles: highlighter supports setting default folding of code…
Browse files Browse the repository at this point in the history
… blocks (#236)
  • Loading branch information
zhuba-Ahhh authored Dec 20, 2024
1 parent 1b89e52 commit e18d1f8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Highlighter/FullFeatured.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,10 @@ export const HighlighterFullFeatured = memo<HighlighterProps>(
actionsRender,
copyable,
type,
defalutExpand = true,
...rest
}) => {
const [expand, setExpand] = useState(true);
const [expand, setExpand] = useState(defalutExpand);
const [lang, setLang] = useState(language);
const { styles, cx } = useStyles(type);

Expand Down
5 changes: 5 additions & 0 deletions src/Highlighter/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ export interface HighlighterProps extends DivProps {
* @default true
*/
copyable?: boolean;
/**
* @description Whether to expand code blocks by default
* @default true
*/
defalutExpand?: boolean;
fileName?: string;
fullFeatured?: boolean;
icon?: ReactNode;
Expand Down

0 comments on commit e18d1f8

Please sign in to comment.