Added difference viewer for XML files.

Review Request #10713 — Created Sept. 11, 2019 and updated

amalik2
Review Board
master
10758, 10749, 10709
reviewboard, students

There is now a syntax highlighted rendered view for XML files, where each node
in the XML document will be consistently indented so that it is easy to see
the actual contents of the document, even if the document is minified or
improperly formatted.

Unicode characters will be properly displayed in the render view as well.

There is also support for comparing different XML files with either the
render view or normal text view.

1) Ran unit tests on Python 2.7 and 3.6.
2) Tested manually on Python 2.7 and 3.6 outside of the diff viewer.
3) Tested manually on Python 2.7 and 3.6 inside of the diff viewer.
4) Tested manually on Python 2.7 and 3.6 with a document with UTF-8 encoding
and characters.
5) Tested manually on Python 2.7 and 3.6 with an invalid XML document that
leads to an error while parsing.

Summary Author
Added difference viewer for XML files.
amalik2
Loading file attachments...

Description From Last Updated

Is this a real CDATA section, e.g. <![CDATA[[< WORKS !!! >]]> If so, it really should render like it is ...

brenniebrennie

F401 'lxml.etree' imported but unused

reviewbotreviewbot

F401 'django.utils.encoding.force_text' imported but unused

reviewbotreviewbot

E127 continuation line over-indented for visual indent

reviewbotreviewbot

E127 continuation line over-indented for visual indent

reviewbotreviewbot

E127 continuation line over-indented for visual indent

reviewbotreviewbot

E127 continuation line over-indented for visual indent

reviewbotreviewbot

E127 continuation line over-indented for visual indent

reviewbotreviewbot

E127 continuation line over-indented for visual indent

reviewbotreviewbot

E127 continuation line over-indented for visual indent

reviewbotreviewbot

E127 continuation line over-indented for visual indent

reviewbotreviewbot

E127 continuation line over-indented for visual indent

reviewbotreviewbot

E127 continuation line over-indented for visual indent

reviewbotreviewbot

E127 continuation line over-indented for visual indent

reviewbotreviewbot

E302 expected 2 blank lines, found 1

reviewbotreviewbot

E302 expected 2 blank lines, found 1

reviewbotreviewbot

E251 unexpected spaces around keyword / parameter equals

reviewbotreviewbot

E251 unexpected spaces around keyword / parameter equals

reviewbotreviewbot

E251 unexpected spaces around keyword / parameter equals

reviewbotreviewbot

E501 line too long (84 > 79 characters)

reviewbotreviewbot

E251 unexpected spaces around keyword / parameter equals

reviewbotreviewbot

W293 blank line contains whitespace

reviewbotreviewbot

W293 blank line contains whitespace

reviewbotreviewbot

W293 blank line contains whitespace

reviewbotreviewbot

W293 blank line contains whitespace

reviewbotreviewbot

W293 blank line contains whitespace

reviewbotreviewbot

W293 blank line contains whitespace

reviewbotreviewbot

W293 blank line contains whitespace

reviewbotreviewbot

W293 blank line contains whitespace

reviewbotreviewbot

W293 blank line contains whitespace

reviewbotreviewbot

W293 blank line contains whitespace

reviewbotreviewbot

E271 multiple spaces after keyword

reviewbotreviewbot

E128 continuation line under-indented for visual indent

reviewbotreviewbot

E128 continuation line under-indented for visual indent

reviewbotreviewbot

E128 continuation line under-indented for visual indent

reviewbotreviewbot

E128 continuation line under-indented for visual indent

reviewbotreviewbot

E128 continuation line under-indented for visual indent

reviewbotreviewbot

E128 continuation line under-indented for visual indent

reviewbotreviewbot

E128 continuation line under-indented for visual indent

reviewbotreviewbot

E231 missing whitespace after ','

reviewbotreviewbot

F811 redefinition of unused 'test_get_siblings_after_root_no_siblings' from line 252

reviewbotreviewbot

E231 missing whitespace after ','

reviewbotreviewbot

E128 continuation line under-indented for visual indent

reviewbotreviewbot

E128 continuation line under-indented for visual indent

reviewbotreviewbot

E128 continuation line under-indented for visual indent

reviewbotreviewbot

E128 continuation line under-indented for visual indent

reviewbotreviewbot

E501 line too long (180 > 79 characters)

reviewbotreviewbot

E128 continuation line under-indented for visual indent

reviewbotreviewbot

E501 line too long (180 > 79 characters)

reviewbotreviewbot

F401 'djblets.markdown.iter_markdown_lines' imported but unused

reviewbotreviewbot

E501 line too long (86 > 79 characters)

reviewbotreviewbot

E302 expected 2 blank lines, found 1

reviewbotreviewbot

E302 expected 2 blank lines, found 1

reviewbotreviewbot

E302 expected 2 blank lines, found 1

reviewbotreviewbot

E302 expected 2 blank lines, found 1

reviewbotreviewbot

E302 expected 2 blank lines, found 1

reviewbotreviewbot

W293 blank line contains whitespace

reviewbotreviewbot

E302 expected 2 blank lines, found 1

reviewbotreviewbot

E201 whitespace after '{'

reviewbotreviewbot

E202 whitespace before '}'

reviewbotreviewbot

E128 continuation line under-indented for visual indent

reviewbotreviewbot

E126 continuation line over-indented for hanging indent

reviewbotreviewbot

E126 continuation line over-indented for hanging indent

reviewbotreviewbot

F821 undefined name '_'

reviewbotreviewbot

E302 expected 2 blank lines, found 1

reviewbotreviewbot

E202 whitespace before '}'

reviewbotreviewbot

E202 whitespace before '}'

reviewbotreviewbot

E202 whitespace before '}'

reviewbotreviewbot

E202 whitespace before '}'

reviewbotreviewbot

E302 expected 2 blank lines, found 1

reviewbotreviewbot

E302 expected 2 blank lines, found 1

reviewbotreviewbot

E302 expected 2 blank lines, found 1

reviewbotreviewbot

E302 expected 2 blank lines, found 1

reviewbotreviewbot

E201 whitespace after '('

reviewbotreviewbot

E201 whitespace after '('

reviewbotreviewbot

E128 continuation line under-indented for visual indent

reviewbotreviewbot

E128 continuation line under-indented for visual indent

reviewbotreviewbot

E128 continuation line under-indented for visual indent

reviewbotreviewbot

E128 continuation line under-indented for visual indent

reviewbotreviewbot

E128 continuation line under-indented for visual indent

reviewbotreviewbot

E128 continuation line under-indented for visual indent

reviewbotreviewbot

E128 continuation line under-indented for visual indent

reviewbotreviewbot

E128 continuation line under-indented for visual indent

reviewbotreviewbot

E128 continuation line under-indented for visual indent

reviewbotreviewbot

E128 continuation line under-indented for visual indent

reviewbotreviewbot

E128 continuation line under-indented for visual indent

reviewbotreviewbot

E128 continuation line under-indented for visual indent

reviewbotreviewbot

W293 blank line contains whitespace

reviewbotreviewbot

E501 line too long (80 > 79 characters)

reviewbotreviewbot

E501 line too long (87 > 79 characters)

reviewbotreviewbot

E501 line too long (97 > 79 characters)

reviewbotreviewbot

E122 continuation line missing indentation or outdented

reviewbotreviewbot

E122 continuation line missing indentation or outdented

reviewbotreviewbot

E122 continuation line missing indentation or outdented

reviewbotreviewbot

E128 continuation line under-indented for visual indent

reviewbotreviewbot

E128 continuation line under-indented for visual indent

reviewbotreviewbot

W291 trailing whitespace

reviewbotreviewbot

E128 continuation line under-indented for visual indent

reviewbotreviewbot

E128 continuation line under-indented for visual indent

reviewbotreviewbot

E501 line too long (87 > 79 characters)

reviewbotreviewbot

E501 line too long (97 > 79 characters)

reviewbotreviewbot

E128 continuation line under-indented for visual indent

reviewbotreviewbot

E128 continuation line under-indented for visual indent

reviewbotreviewbot

E128 continuation line under-indented for visual indent

reviewbotreviewbot

E127 continuation line over-indented for visual indent

reviewbotreviewbot

E501 line too long (87 > 79 characters)

reviewbotreviewbot

E501 line too long (97 > 79 characters)

reviewbotreviewbot

E127 continuation line over-indented for visual indent

reviewbotreviewbot

E128 continuation line under-indented for visual indent

reviewbotreviewbot

E501 line too long (87 > 79 characters)

reviewbotreviewbot

E501 line too long (97 > 79 characters)

reviewbotreviewbot

E128 continuation line under-indented for visual indent

reviewbotreviewbot

E501 line too long (87 > 79 characters)

reviewbotreviewbot

E501 line too long (97 > 79 characters)

reviewbotreviewbot

E501 line too long (87 > 79 characters)

reviewbotreviewbot

E501 line too long (97 > 79 characters)

reviewbotreviewbot

F821 undefined name 'contents'

reviewbotreviewbot

F821 undefined name 'contents'

reviewbotreviewbot

E501 line too long (84 > 79 characters)

reviewbotreviewbot

E501 line too long (81 > 79 characters)

reviewbotreviewbot

W293 blank line contains whitespace

reviewbotreviewbot

F811 redefinition of unused 'RemovedInReviewBoard60Warning' from line 42

reviewbotreviewbot
Checks run (1 failed, 1 succeeded)
flake8 failed.
JSHint passed.

flake8

amalik2
Review request changed

Checks run (1 failed, 1 succeeded)

flake8 failed.
JSHint passed.

flake8

amalik2
Review request changed

Checks run (1 failed, 1 succeeded)

flake8 failed.
JSHint passed.

flake8

amalik2
Review request changed

Commits:

Summary Author
-
Added difference viewer for XML files.
amalik2
-
fixed more review bot errors
amalik2
+
Added difference viewer for XML files.
amalik2
+
fixed even more errors
amalik2
+
fixed more review bot errors
amalik2

Diff:

Revision 4 (+1533 -59)

Show changes

Checks run (1 failed, 1 succeeded)

flake8 failed.
JSHint passed.

flake8

amalik2
amalik2
brennie
  1. 
      
  2. Is this a real CDATA section, e.g.

    <![CDATA[[< WORKS !!! >]]>

    If so, it really should render like it is written.

    1. It's <![CDATA[[CDATA < WORKS !!! >]]]> I believe, can't remember the exact CDATA format. I'm not sure if it's better to display the actual text contents of the CDATA, or to include the CDATA declaration wrapping around the contents. I just went with the contents, but let me know if you guys would prefer to have the declaration as well instead.

    2. Maybe some formatting (background/highlight perhaps) that indicates that the node is CDATA? Not a super high priority, esp since we can view the raw text.

    3. I've changed it now to include the CDATA wrapper. It's also syntax highlighted now :)

  3. 
      
amalik2
Review request changed

Summary:

-Added difference viewer for XML files.
+WIP: Added difference viewer for XML files.

Commits:

Summary Author
-
Added difference viewer for XML files.
amalik2
-
fixed even more errors
amalik2
-
fixed more review bot errors
amalik2
+
Added difference viewer for XML files.
amalik2
+
fixed even more errors
amalik2
+
fixed more review bot errors
amalik2
+
added checkbox to toggle same line rendering for text
amalik2

Diff:

Revision 5 (+2211 -361)

Show changes

Checks run (1 failed, 1 succeeded)

flake8 failed.
JSHint passed.

flake8

amalik2
Review request changed

Commits:

Summary Author
-
Added difference viewer for XML files.
amalik2
-
fixed even more errors
amalik2
-
fixed more review bot errors
amalik2
-
added checkbox to toggle same line rendering for text
amalik2
+
Added difference viewer for XML files.
amalik2
+
fixes
amalik2
+
fixed even more errors
amalik2
+
fixed more review bot errors
amalik2
+
added checkbox to toggle same line rendering for text
amalik2

Diff:

Revision 6 (+2232 -372)

Show changes

Checks run (1 failed, 1 succeeded)

flake8 failed.
JSHint passed.

flake8

amalik2
Review request changed

Commits:

Summary Author
-
Added difference viewer for XML files.
amalik2
-
fixes
amalik2
-
fixed even more errors
amalik2
-
fixed more review bot errors
amalik2
-
added checkbox to toggle same line rendering for text
amalik2
+
Added difference viewer for XML files.
amalik2
+
fixes
amalik2
+
fixed even more errors
amalik2
+
fixed more review bot errors
amalik2
+
more fixes
amalik2
+
added checkbox to toggle same line rendering for text
amalik2

Diff:

Revision 7 (+2236 -376)

Show changes

Checks run (1 failed, 1 succeeded)

flake8 failed.
JSHint passed.

flake8

amalik2
Review request changed

Commits:

Summary Author
-
Added difference viewer for XML files.
amalik2
-
fixes
amalik2
-
fixed even more errors
amalik2
-
fixed more review bot errors
amalik2
-
more fixes
amalik2
-
added checkbox to toggle same line rendering for text
amalik2
+
fixed over identation?
amalik2
+
Added difference viewer for XML files.
amalik2
+
fixes
amalik2
+
fixed even more errors
amalik2
+
fixed more review bot errors
amalik2
+
more fixes
amalik2
+
added checkbox to toggle same line rendering for text
amalik2

Diff:

Revision 8 (+2238 -378)

Show changes

Checks run (1 failed, 1 succeeded)

flake8 failed.
JSHint passed.

flake8

amalik2
Review request changed

Commits:

Summary Author
-
fixed over identation?
amalik2
-
Added difference viewer for XML files.
amalik2
-
fixes
amalik2
-
fixed even more errors
amalik2
-
fixed more review bot errors
amalik2
-
more fixes
amalik2
-
added checkbox to toggle same line rendering for text
amalik2
+
fixed over identation?
amalik2
+
Added difference viewer for XML files.
amalik2
+
fixes
amalik2
+
fixed even more errors
amalik2
+
fixed more review bot errors
amalik2
+
more fixes
amalik2
+
indentation fix
amalik2
+
added checkbox to toggle same line rendering for text
amalik2

Diff:

Revision 9 (+2242 -382)

Show changes

Checks run (1 failed, 1 succeeded)

flake8 failed.
JSHint passed.

flake8

amalik2
Review request changed

Commits:

Summary Author
-
fixed over identation?
amalik2
-
Added difference viewer for XML files.
amalik2
-
fixes
amalik2
-
fixed even more errors
amalik2
-
fixed more review bot errors
amalik2
-
more fixes
amalik2
-
indentation fix
amalik2
-
added checkbox to toggle same line rendering for text
amalik2
+
fixed documentation for xml model
amalik2
+
fixed over identation?
amalik2
+
Added difference viewer for XML files.
amalik2
+
fixes
amalik2
+
fixed even more errors
amalik2
+
fixed more review bot errors
amalik2
+
more fixes
amalik2
+
indentation fix
amalik2
+
added checkbox to toggle same line rendering for text
amalik2

Diff:

Revision 10 (+2241 -395)

Show changes

Checks run (1 failed, 1 succeeded)

flake8 failed.
JSHint passed.

flake8

amalik2
amalik2
amalik2
Review request changed

Commits:

Summary Author
-
fixed encoding issue
amalik2
-
Added difference viewer for XML files.
amalik2
-
Removed render options from text template
amalik2
+
fixed encoding issue
amalik2
+
Added difference viewer for XML files.
amalik2
+
Removed render options from text template
amalik2
+
removed hack for extra whitespace fix
amalik2

Diff:

Revision 13 (+1841 -41)

Show changes

Checks run (1 failed, 1 succeeded)

flake8 failed.
JSHint passed.

flake8

amalik2
amalik2
Review request changed

Summary:

-WIP: Added difference viewer for XML files.
+Added difference viewer for XML files.

Commits:

Summary Author
-
fixed encoding issue
amalik2
-
Added difference viewer for XML files.
amalik2
-
Removed render options from text template
amalik2
-
removed hack for extra whitespace fix
amalik2
-
removed unused function
amalik2
+
Added difference viewer for XML files.
amalik2

Diff:

Revision 15 (+1682 -2)

Show changes

Checks run (1 failed, 1 succeeded)

flake8 failed.
JSHint passed.

flake8

amalik2
amalik2
amalik2
amalik2
amalik2
amalik2
Review request changed

Checks run (1 failed, 1 succeeded)

flake8 failed.
JSHint passed.

flake8

amalik2
Review request changed

Checks run (2 succeeded)

flake8 passed.
JSHint passed.
Loading...