const hl = Ant.highlight; const render = hl.render; function assertEq(actual, expected, label) { if (actual !== expected) throw new Error(`${label}: expected ${JSON.stringify(expected)} got ${JSON.stringify(actual)}`); } console.log(render('Red text and back to normal')); console.log(render('Green, Blue, Yellow')); console.log(render('Bright Red vs Normal Red')); console.log(render('Red background with text')); console.log(render('Blue bg with white text')); console.log(render('Bold text and dim text')); console.log(render(' text')); console.log(render('Italic or italic, strikethrough, inverted')); console.log(render('Bold red or bold blue')); console.log(render('Dim cyan and italic green')); console.log(render('<#ff8800>Orange hex color')); console.log(render('<#0f0>Bright green shorthand')); console.log(render('Magenta background')); console.log(render('Number: 42, String: hello')); console.log(render('Hex: 0xff, Float: 3.14')); console.log(render('red back to normal immediately')); console.log(render('Literal <<: less than, >>: greater than')); console.log(render('Literal %%: percent sign')); const code = `\nconst x = 42; function greet(name) { console.log(\`Hello, \${name}!\`); }`; console.log(hl(code)); const lineComment = hl.tags('//hello\nworld'); assertEq(lineComment, '<#758CA3>//hello\nworld', 'line comment stops at newline'); const blockComment = hl.tags('/*hello\nworld'); assertEq(blockComment, '<#758CA3>/*hello\nworld', 'block comment continues across newline'); console.log('highlight comment specs ok');