Closed AugustinMauroy closed 1 year ago
You can do this
import { Code } from 'bright';
const highlight = {
name: 'highlight',
MultilineAnnotation: ({ children }) => {
return <span className="block bg-blue-700 bg-opacity-50">{children}</span>;
},
};
const code = `
// highlight(2,3)
console.log("hello world")
console.log("hello world")
console.log("hello world")
console.log("hello world")
`;
export function Fence() {
return (
<Code
lang="js"
extensions={[highlight]}
>
{code}
</Code>
)
}
Ok thanks !
I just want to highlight code. And rest is custom component how to do that ?