Skip to content

highlightBracketPairsOnHover

highlightBracketPairsOnHover(container, pairs): void

Defined in: client/hover.ts:129

Highlights bracket pairs when hovered. Clicking on a pair keeps it highlighted. Clicking anywhere inside the container removes the highlight.

This will match all brackets under the container together. If there are multiple code blocks underneath, then brackets from different code blocks might get matched together.

Note that there should not be any editors inside your container as this can cause issues.

Container to add bracket pair highlighting to.

HTMLElement | PrismCodeBlock

string = "()[]{}"

Which characters to match together. The opening character must be followed by the corresponding closing character. Defaults to ”()[]{}”.

void