Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/361.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何使用docxtemplater将换行符放在文本之后_Javascript_Docxtemplater - Fatal编程技术网

Javascript 如何使用docxtemplater将换行符放在文本之后

Javascript 如何使用docxtemplater将换行符放在文本之后,javascript,docxtemplater,Javascript,Docxtemplater,我正在使用docxtemplater模块填充MS Word文档上的模板。我使用过这个,但它只是为模板添加了空间: var EOL = "\n"; var willBeTemplated = "Something" + EOL; 我怎样才能在这段文字后加上换行符?我是docxtemplater的创建者 您可以使用以下代码: constdoc=newdocxtemplater(zip,{linebreaks:true}); 默认情况下,docxtempla

我正在使用docxtemplater模块填充MS Word文档上的模板。我使用过这个,但它只是为模板添加了空间:

var EOL = "\n";
var willBeTemplated = "Something" + EOL;

我怎样才能在这段文字后加上换行符?

我是docxtemplater的创建者

您可以使用以下代码:

constdoc=newdocxtemplater(zip,{linebreaks:true});
默认情况下,docxtemplater不考虑换行符,但使用此选项将添加换行符


我可以向您咨询以下方面的建议: