下面的代码块用于测试 Docusaurus 的 Prism magicComments 配置效果。
add-start / add-end
add-example.jsjs
console.log('这行会被高亮为添加');
console.log('普通行');
delete-start / delete-end
delete-example.jsjs
console.log('这行会被高亮为删除');
console.log('普通行');
edit-start / edit-end
edit-example.jsjs
console.log('这行会被高亮为编辑');
console.log('普通行');
highlight-start / highlight-end
highlight-example.jsjs
console.log('这行会被高亮');
console.log('普通行');
error
error-example.jsjs
console.log('Hello World')
throw new Error('Test error')