Skip to content

Problem with HTML comments comparison  #276

@rszachtsznajder

Description

@rszachtsznajder

I've tried to use latest diff2html (at this moment 3.0.0-master.aa6dd18). I found an issue related to HTML comparison. It doesn't work properly with HTML comments. Take a look on the example below.

diff file:

--- src/index.html
+++ src/index.html
@@ -1,2 +1,2 @@
-<!-- commented code -->
-</div>
+<html>
+<body>

result is printed as:

diff2html-issue

configuration

{ 
    drawFileList: false, 
    matching: LineMatchingType.LINES, 
    diffStyle: DiffStyleType.WORD,
}

After some time of debugging I found that the issue concerns also other HTML elements that starts with "<" followed by non-letter character (for example <!DOCTYPE html> - here is "!" sign after "<").

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions