维护Eclipse中自动格式化的XML注释部分的格式

问题描述 投票:6回答:2

在Eclipse(Helios)中,我有这个XML源文件:

<?xml version="1.0" encoding="utf-8"?>
<!--
I wanted to 
===========
save this format of the comments.

-->
<x>
</x>

在格式化文件(Ctrl + Shift + F)时,我重新格式化了评论。

<?xml version="1.0" encoding="utf-8"?>
<!-- I wanted to =========== save this format of the comments. -->
<x>
</x>

是否可以选择关闭漂亮的评论部分?

xml eclipse pretty-print
2个回答
10
投票

我正在使用Eclipse 3.6.0。

在Windows>首选项> XML> XML文件>编辑器中:

取消选中“加入行”选项。


1
投票

您只能选择部分XML文件进行格式化,并省略注释部分。

© www.soinside.com 2019 - 2024. All rights reserved.