V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
intellectual
V2EX  ›  Visual Studio Code

VScode html 格式化的时候怎么排除文本,不让文本格式化呢?

  •  
  •   intellectual · 2017-08-25 10:38:22 +08:00 · 2853 次点击
    这是一个创建于 2450 天前的主题,其中的信息可能已经有所发展或是发生改变。

    官方说这样设置可以排除一部分 html 里面的标签不会格式化:

    {
        "html.format.unformatted": "abbr, acronym, b, bdo, big, br, button, cite, code, dfn, em, i, img, input, kbd, label, map, object, q, samp, select, small, span, strong, sub, sup, textarea, tt, var"
        }
    

    如果是不带标签的文本怎么来设置呢?比如#开头的这几行,不想格式化的:

    <div class="focusImg">
                <ul class="slidePic">
                    #set($picnewss = "") 
                    #set($picnewss = $!{manualTool.picnews(11311)})
                    #foreach($picnews in $picnewss)
                    <li>
                        <a href="$!{picnews.target_url}" title="$!{picnews.title}" target="_blank">
                            <img src="$!{picnews.image_url}" alt="$!{picnews.title}" width="368" height="328">
                            <i class="bg"></i>
                            <p>$!{stringTool.substr($picnews.title,40,"...")}</p>
                        </a>
                    </li>
                    #end
                </ul>
                <ul class="hd">
    
    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   974 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 21:35 · PVG 05:35 · LAX 14:35 · JFK 17:35
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.