0

Collaborator 使用 DiffMerge 比较文件。它提供了一种添加规则集的方法。没有为 XML 文件提供任何内容。我希望能够在不包括评论的情况下进行比较。我可以在同一行上获得部分来表现\<!--.*--\>

多行注释不起作用。

4

1 回答 1

0

更好,但并不接近完美。XML 确实需要...

在任何情况下,为多行注释创建自定义上下文确实会将这些注释排除在“this changed”测试之外。

    Ruleset: XML Files
    Suffixes: xml runsettings config
    Line Match Handling: [0x00000010]
        Ignore/Strip EOLs: true
        Ignore/Fold Case: true
        Strip Whitespace: true
            Also Treat TABs as Whitespace: true
    Default Context Guidelines: [0x0000001a]
        Classify Differences as Important: true
            EOL differences are important: N/A
            Case differences are important: true
            Whitespace differences are important: false
                Treat TABs as Whitespace: true
    Custom Contexts: [1 contexts]
        Context[0]: Comment: \<!-- to --\> (Escape character \)
            Guidelines: [0x0000001b]
                Classify Differences as Important: false
                    EOL differences are important: N/A
                    Case differences are important: N/A
                    Whitespace differences are important: N/A
                        Treat TABs as Whitespace: N/A
    Character Encoding:
        Automatically detect Unicode BOM: true
        Fallback Handling: Use System Local/Default
    Lines To Omit: [3 patterns]
        LOmit[0]: Each Line Matching: ^[[:blank:]]*$
        LOmit[1]: Each Line Matching: \f
        LOmit[2]: Each Line Matching: \<!--.*--\>

重要的部分是上下文开始\<!--、结束--\>、转义字符\

并意识到被忽略的内容不会变灰。

于 2015-10-16T17:29:33.707 回答