简体   繁体   中英

Maintain format of XML comment section on auto-formatting in Eclipse

In Eclipse (Helios) I have this XML source file:

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

-->
<x>
</x>

On formatting the file (Ctrl+Shift+F) I got the comment reformatted.

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

Is there an option to switch off pretty-printing comment sections?

I'm using Eclipse 3.6.0.

In Windows > Preferences > XML > XML Files > Editor:

Uncheck the Join lines option.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM