我想把这段代码放到 Jade 中(缩进是一个制表符):
function isSafe(number) {
return /^\d+(\.\d+)?(e\d+)?$/i.test(number);
}
typeof number === 'string' && isSafe(number) && typeof eval(number) !== 'number'
当我这样做时,空白行消失:
pre
code
| function isSafe(number) {
| return /^\d+(\.\d+)?(e\d+)?$/i.test(number);
| }
| typeof number === 'string' && isSafe(number) && typeof eval(number) !== 'number'
当我这样做时,管道出现:
pre
code
| function isSafe(number) {
| return /^\d+(\.\d+)?(e\d+)?$/i.test(number);
| }
|
| typeof number === 'string' && isSafe(number) && typeof eval(number) !== 'number'
当我这样做时,选项卡变成了一个空格:
pre
code.
function isSafe(number) {
return /^\d+(\.\d+)?(e\d+)?$/i.test(number);
}
typeof number === 'string' && isSafe(number) && typeof eval(number) !== 'number'
标记它的正确方法是什么?