rtfpessoa / diff2html

Pretty diff to html javascript library (diff2html)
https://diff2html.xyz
MIT License
2.88k stars 278 forks source link

weird overlap of lines #156

Closed jmecosta closed 6 years ago

jmecosta commented 6 years ago

Step 0: Describe your environment

Step 1: Describe the problem:

using example in readme.md, i get this:

image

let strInput = "--- a/server/vendor/golang.org/x/sys/unix/zsyscall_linux_mipsle.go\n+++ b/server/vendor/golang.org/x/sys/unix/zsyscall_linux_mipsle.go\n@@ -1035,6 +1035,17 @@ func Prctl(option int, arg2 uintptr, arg3 uintptr, arg4 uintptr, arg5 uintptr) (\n \n // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n \n+func Pselect(nfd int, r FdSet, w FdSet, e FdSet, timeout Timespec, sigmask *Sigsett) (n int, err error) {\n+\tr0, , e1 := Syscall6(SYS_PSELECT6, uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), uintptr(unsafe.Pointer(sigmask)))\n+\tn = int(r0)\n+\tif e1 != 0 {\n+\t\terr = errnoErr(e1)\n+\t}\n+\treturn\n+}\n+\n+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n+\n func read(fd int, p []byte) (n int, err error) {\n \tvar _p0 unsafe.Pointer\n \tif len(p) > 0 {\n"; diff2htmlUi = new Diff2HtmlUI({ diff: strInput }); diff2htmlUi.draw('#outputHtml', { inputFormat: 'json', showFiles: true, matching: 'lines', outputFormat: 'side-by-side' });

                <div role="tabpanel" class="tab-pane fade" id="referencesDiffTab">
                    <div>
                        <div id="outputHtml"></div>
                    </div>
                </div>

other libs

<link href="css/tether.min.css" rel="stylesheet" />
<link href="css/bootstrap.min.css" rel="stylesheet" />
<link href="css/farmi.css" rel="stylesheet" />
<link href="css/font-awesome.min.css" rel="stylesheet">
<link href="css/codemirror.css" rel="stylesheet">
<link href="css/vue-multiselect.min.css" rel="stylesheet">
<link href="css/diff2html.css" rel="stylesheet">

Supose is related with bootstrap or vue.js? im using some codemirror instances a lot in the same page. Can that affect?

thanks in advance

jorge costa

rtfpessoa commented 6 years ago

Just checked and here seems normal. Might be related to any css you have in the page. Like table styles, spacing, etc.

The CSS is not very bullet proof.

rtfpessoa commented 6 years ago

Closing due to inactivity. Let me know if I can help with anything else

jmecosta commented 6 years ago

I'm working on other stuff, during next week i will come back to this to see if I can spot the issue. Thanks anyway

jmecosta commented 6 years ago

yep, it was a table td style that was messing up the all thing. thanks