No announcement yet.

Compare html and display styled

  • Filter
  • Time
  • Show
Clear All
new posts

  • Compare html and display styled

    Hi all.
    I wonder if it's possible with BC to compare two HTML files and display the result as a HTML file where removed text is coloured red en new text is coloured green (or so). I would like to make the differences visually visible.

    For as far as I can see in the manual, this seems not possible. But I don't want to show the user the source of the html file like all the examples do.

    So, summarised, a deleted text should appear like this:
    HTML Code:
    <span class="removedtext">This text is removed</span>
    and new text should appear as
    HTML Code:
    <span class="addedtext">This text is new</span>
    Last edited by Mentos; 12-Nov-2008, 08:46 AM. Reason: Spell

  • #2
    You can do this with the HTML to Text add on for Beyond Compare 3. You can get it from:

    The add on will strip out HTML formatting tags from files before comparing them, so you'll only see differences in the visible text. Once you have the files compared with the add on, you can save the comparison results as HTML using the Session > Text Compare Report command, then select HTML as the output type.
    Chris K Scooter Software


    • #3
      OK Chris, thanks for the reply. Does this mean that the final result is only the unformatted text with the differences marked? Or is it possible to (somehow) insert the original HTML formatting again after the comparison?

      The result should actually be formatted text extended with the marked differences.


      • #4
        The "HTML to text" add on strips all HTML tags from a file, so you only see unformatted text contents of the file with differences colored. It isn't possible to insert the original formatting after the comparison.

        If you want to see differences in the HTML code, use the built in HTML file format without downloading any add ons.

        You can customize the HTML report output with a custom stylesheet.
        Chris K Scooter Software


        • #5
          Originally posted by Chris View Post
          If you want to see differences in the HTML code, use the built in HTML file format without downloading any add ons.
          I think I need to tell that I would like to use BC from the command line. All the available options seem to present the results as differences in the source, not as parse-able HTML.


          • #6
            BC can generate output to a printer, HTML, or plain text.

            To save a report as HTML in a script, use the "output-options:html-color" option for the "file-report" or "folder-report" command. For details on scripting, see the "Using Beyond Compare > Command Line and Scripting" section of Beyond Compare 3's help file.
            Chris K Scooter Software


            • #7
              I'd like to resurrect this thread as it doesn't seem to have been answered. The question was whether two html pages can be compared and the diff shown over the html, not whether a text diff can be stored as an html. For example, if I compare two html tables (<th>, <tr>, <td>, ...) which are nicely formatted, I wan to see both the diff (green/red) and this original nice formatting (not the html tags). Anyone?



              • #8

                The report can only generate output based on the current display. By default HTML files are displayed as code, which would then be the content of the report.

                The original thread was dealing with the difference between the default HTML (Code) and HTML To Text format (which shows the text data of the HTML without the code). Both of these formats are specifically text. We do have an "HTML tables" format, which opens only the table of an HTML file in the Table Compare (which offers an Excel-like interface comparing rows/columns). This doesn't keep the formatting of your Table, but does offer a different style if that helps. You can search for HTML additional formats here:
                Beyond Compare is a multi-platform utility that combines directory compare and file compare functions in one package. Use it to manage source code, keep directories in sync, compare program output, etc.

                One installed, the Tools menu -> File Formats dialog controls which is used automatically: the topmost format for *.html in the list.
                Aaron P Scooter Software