如何在 Visual Studio Code 中格式化 PHP 文件中的 HTML [英] How to format HTML in a PHP file in Visual Studio Code

查看:39
本文介绍了如何在 Visual Studio Code 中格式化 PHP 文件中的 HTML的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试过了:

  • ALT + SHIFT + F
  • CTRL + K, CTRL + D
  • CTRL + K, CTRL + F
  • ALT + SHIFT + F
  • CTRL + K, CTRL + D
  • CTRL + K, CTRL + F

此外,当我通过 CTRL + SHIFT + P 搜索格式时,也没有搜索结果.

Also when I search for format via CTRL + SHIFT + P, there are no search results.

推荐答案

问题是如果文件具有 PHP 扩展名 (index.php),Visual Studio Code 将不会格式化 HTML.我将发布一个包含此信息的新问题.

The problem is that Visual Studio Code won't format HTML if the file has a PHP extension (index.php). I'm going to post a new question that includes this information.

这篇关于如何在 Visual Studio Code 中格式化 PHP 文件中的 HTML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆