gpt4 book ai didi

html - 是否可以在 ruby​​mine 中格式化/回流 html?

转载 作者:搜寻专家 更新时间:2023-10-31 08:08:33 27 4
gpt4 key购买 nike

是否可以在 RubyMine 3.2.4 中格式化或重新缩进 html?我尝试了 Code... Reformat Code 但它似乎对 HTML 没有任何作用。我需要插件吗?

最佳答案

它确实有效。

使用生成的标准 404.html 文件:

<!DOCTYPE html>
<html>
<head>
<title>The page you were looking for doesn't exist (404)</title>
<style type="text/css">
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
div.dialog {
width: 25em;
padding: 0 4em;
margin: 4em auto 0 auto;
border: 1px solid #ccc;
border-right-color: #999;
border-bottom-color: #999;
}
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
</style>
</head>

<body>
<!-- This file lives in public/404.html -->
<div class="dialog">
<h1>The page you were looking for doesn't exist.</h1>
<p>You may have mistyped the address or the page may have moved.</p>
</div>
</body>
</html>

我使用了代码/重新格式化选项,结果如下:

<!DOCTYPE html>
<html>
<head>
<title>The page you were looking for doesn't exist (404)</title>
<style type="text/css">
body {
background-color: #fff;
color: #666;
text-align: center;
font-family: arial, sans-serif;
}

div.dialog {
width: 25em;
padding: 0 4em;
margin: 4em auto 0 auto;
border: 1px solid #ccc;
border-right-color: #999;
border-bottom-color: #999;
}

h1 {
font-size: 100%;
color: #f00;
line-height: 1.5em;
}
</style>
</head>

<body>
<!-- This file lives in public/404.html -->
<div class="dialog">
<h1>The page you were looking for doesn't exist.</h1>

<p>You may have mistyped the address or the page may have moved.</p>
</div>
</body>
</html>

您可以看到它是如何重新格式化样式的(如果我更改换行符等,它也会修复这些)。

如果您转到文件/设置,IDE 设置/编辑器,然后确保选项显示“重新格式化代码”对话框被选中 [x],再试一次。它可能被设置为只修复选定的文本?或者……

关于html - 是否可以在 ruby​​mine 中格式化/回流 html?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8101493/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com