@tmlmt/cooklang-parser / formatCodeFrame
Function: formatCodeFrame()
formatCodeFrame(
span,source,label?):string
Renders a source span as a code frame (location marker, source lines and caret pointers), without any diagnostic header.
Parameters
span
The span to render. Positions refer to source.
source
string
The original text the span refers to.
label?
string = "recipe"
Optional label shown in the location marker (default "recipe").
Returns
string
A multi-line plain-text string.