我用的是帕格/玉器和吞咽数据&吞咽-合并-json。我找不到办法在我的Json里插入断线。我试图在json中插入:
\n\"\\\/\b\f\r\u都不管用。我设法让一个空格使用\t,但我真的需要能够使用换行。
var data = require('gulp-data');
fs = require('fs'),
path = require('path'),
merge = require('gulp-merge-json');
var pug = require('gulp-pug');
gulp.task('pug:data', function() {
return gulp.src('assets/json/**/*.json')
.pipe(merge({
fileName: 'data.json',
edit: (json, file) => {
// Extract the filename and strip the extension
var filename = path.basename(file.path),
primaryKey = filename.replace(path.extname(filename), '');
// Set the filename as the primary key for our JSON data
var data = {};
data[primaryKey.toUpperCase()] = json;
return data;
}
}))
.pipe(gulp.dest('assets/temp'));
});下面是帕格代码:
#abouttxt.hide.block.big.centered.layer_top
| #{ABOUT[langage]}下面是名为About.json的Json:
{"en": "Peace, Love, Unity and Having fun* !",
"fr": "Ecriture et Réalisation\nVina Hiridjee et David Boisseaux-Chical\n\nDirection artistique et Graphisme\nNicolas Dali\n\nConception et Développement\nRomain Malauzat
Production\nKomet Prod ...... etc"
}发布于 2018-10-05 20:44:19
我看得不够好,我的错。你可以像这样做未转义的字符串插值。
!{ABOUT[langage]}https://stackoverflow.com/questions/52651459
复制相似问题