Bright / Recipes / Focus

Demo

function lorem(ipsum, dolor = 1) {
const sit = ipsum == null ? 0 : ipsum.sit;
dolor = sit - amet(dolor);
return dolor;
}

Source

import { Code } from "bright"
import { focus } from "./extension"

const myCode = `
function lorem(ipsum, dolor = 1) {
const sit = ipsum == null ? 0 : ipsum.sit;
// focus(1:2)
dolor = sit - amet(dolor);
return dolor;
}
`.trim()

export default function Page() {
return (
<Code lang="js" extensions={[focus]}>
{myCode}
</Code>
)
}

Link to the demo on GitHub