Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/41.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/batch-file/5.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
Html 更漂亮的是打破胡子模板_Html_Css_Mustache_Prettier - Fatal编程技术网

Html 更漂亮的是打破胡子模板

Html 更漂亮的是打破胡子模板,html,css,mustache,prettier,Html,Css,Mustache,Prettier,我正在运行摩纳哥编辑器在浏览器中编辑我的胡子文件。 我已经使用prettier设置了自定义代码格式化程序。问题是当有样式标记时,它在错误的时间添加换行符。是否可以防止这种格式设置 <style> :root { --green: {{{data.colours.green}}}; --blue: {{{data.colours.blue}}}; } </style> <h1>Formatting br

我正在运行摩纳哥编辑器在浏览器中编辑我的胡子文件。 我已经使用prettier设置了自定义代码格式化程序。问题是当有样式标记时,它在错误的时间添加换行符。是否可以防止这种格式设置

<style>
      :root {
        --green: {{{data.colours.green}}};
        --blue: {{{data.colours.blue}}};
      }
  </style>
<h1>Formatting breaks for css templates</h1>
<p>{{{data.colours.red}}}</p>
</html>
<html>
    <style>
  :root {
    --green: {
        {
          {
          data.colours.green
        }
      }
    }

    ;

    --blue: {
        {
          {
          data.colours.blue
        }
      }
    }

    ;
  }
</style>
    <h1>
        Formatting breaks for css templates
    </h1>
    <p>
        {{{data.colours.red}}}
    </p>
</html>
      monaco.languages.registerDocumentFormattingEditProvider('text/html', {
        async provideDocumentFormattingEdits(model) {
          const text = prettier.format(model.getValue(), { parser: "glimmer", htmlWhitespaceSensitivity: 'strict' });      
          return [
            {
              range: model.getFullModelRange(),
              text,
            },
          ];
        },
      });