Skip to content

Commit

Permalink
delete block identifier
Browse files Browse the repository at this point in the history
  • Loading branch information
MooKorea committed Oct 27, 2023
1 parent beb32a0 commit 2183b6f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/assets/pages/documentation/Body.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default function Body({ initialPage }) {
}, [page, initialPage]);

const options = {
replace: ({ name, attribs, children, data }) => {
replace: ({ name, attribs, children, data, type }) => {
//convert all images to clickable images
if (name === "img") {
return <Image attribs={attribs} />;
Expand All @@ -40,7 +40,7 @@ export default function Body({ initialPage }) {
</a>
);
}

//content blocks
function handleContentBlock(data) {
const type = ["Note", "See Also", "Warning"];
Expand All @@ -66,6 +66,12 @@ export default function Body({ initialPage }) {
</div>
);
}

//delete block identifier
if (type === "text" && handleContentBlock(data)) {
const type = handleContentBlock(data);
return <>{data.slice(type.length + 1)}</>;
}
},
};

Expand Down

0 comments on commit 2183b6f

Please sign in to comment.