Git Product home page Git Product logo

Comments (12)

rtfpessoa avatar rtfpessoa commented on May 24, 2024

Hi @rmpestano , apparently I broke it with the last fix.
The parser was missing a test for binary files.

Will release a fix soon.

from diff2html.

rmpestano avatar rmpestano commented on May 24, 2024

great 👍

from diff2html.

rtfpessoa avatar rtfpessoa commented on May 24, 2024

@rmpestano released as version [email protected]

from diff2html.

rmpestano avatar rmpestano commented on May 24, 2024

Its working great now, thank you very much!

from diff2html.

rmpestano avatar rmpestano commented on May 24, 2024

Hi again @rtfpessoa,

Although it is working I'm getting the following javascript error (only when there are binary diffs):

Failed to parse lines, starting in 0!startBlock @ diff2html-2.0.0-rc.9.min.js:3

Attached a zip containing a sample.

diff2html-sample.zip

from diff2html.

rtfpessoa avatar rtfpessoa commented on May 24, 2024

That is "expected" behaviour.

If I cannot find @@ ........ @@ I log that error.

Maybe I can log it only If the line starts with @ and ignore it there is no such line, like in binary files.

from diff2html.

rtfpessoa avatar rtfpessoa commented on May 24, 2024

@rmpestano just did a quick fix for the binary files.

BTW, also released major version 2.0.0 after the first fix (for more than a month to do it).

So this fix is in [email protected].

from diff2html.

rmpestano avatar rmpestano commented on May 24, 2024

@rtfpessoa, working without errors now, thank you again 👍

from diff2html.

rahulnjs avatar rahulnjs commented on May 24, 2024

@rtfpessoa is there a flag to ignore binary files? seems to be a good usecase.

from diff2html.

rtfpessoa avatar rtfpessoa commented on May 24, 2024

@rahulnjs can you provide more context about your use case?

You can do that when generating the diff, or you can even do:

  1. Parse diff string to json using diff2html
  2. Filter binary files from the json
  3. Generate html using diff2html with the filtered json

In general I think it would be too simple to do outside, cannot find a good use case to bundle that.
Let me know if you have more information.

from diff2html.

rahulnjs avatar rahulnjs commented on May 24, 2024

@rtfpessoa I understand your point.

But when diff2html is already doing so much wouldn't it be nice to filter it during parsing or even during html generation. Which would save me all the 3 steps you have mentioned. So the code remains clean.

All I have to pass is,

{
     ignoreBinary : true | false
}

Thanks.

from diff2html.

rtfpessoa avatar rtfpessoa commented on May 24, 2024

@rahulnjs when you say:

when diff2html is already doing so much

I am not sure what you really mean.
Today diff2html only does parsing of diffs and html generation. At most you can configure some important features of each of these features.
If we start adding too many unrelated features it will easily get bloated and over-complicated.

I think what you are requesting is mostly a feature of the diff generation, since it makes no sense to generate it for files that you are not interested to see.

Sorry to be too persistent but I really would like to avoid getting to many things in here.

from diff2html.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.