-
-
Notifications
You must be signed in to change notification settings - Fork 30
Open
Labels
Description
Describe the bug
- When an html file is opened it is modified before it is displayed.
- When an html file is saved it modified before it is saved.
NOTE: This issue is about
- autoclosing empty tags in HTML that are not allowed to be autoclosing such as
<script> - swallowing CDATA sections and escaping the enclosed content
Both are likely due to some serialization that takes place.
Expected behavior
A source file is opened and displayed as it is stored within the database.
A source file created or modified in eXide is stored unmodified.
To Reproduce
- store a file
/db/apps/test/test.htmlin the database with following contents
NOTE: you have to use other means than eXide to do that, obviously. Think: WebDav, rest (curl), XML-RPC (xst)
<html>
<body>
<main></main>
<script type="text/javascript"><![CDATA[ console.log(true && 1 < 2) ]]></script>
</body>
</html>- open the file in eXide and you will get
- an autoclosed, empty main-element (this is fine for XML but detrimental for HTML)
- the CDATA section is lost and its contents are now escaped with entities
<html>
<body>
<main/>
<script type="text/javascript"> console.log(true && 1 < 2) </script>
</body>
</html>- modify the contents to the original content again and save it
- load the contents via WebDav, REST, XML-RPC again (
curl http://localhost:8080/exist/rest/db/apps/test/test.html) - the CDATA section was swallowed and its enclosed content escaped with entities
NOTE: That the file has an XML declaration now might be due to the serialization on retrieval viacurl
<?xml version="1.0" encoding="UTF-8"?>
<html>
<body>
<main></main>
<script type="text/javascript"> console.log(true && 1 < 2) </script>
</body>
</html>- reloading the file also changes the contents back to what we got at step 2
Integration Test (TODO)
For UI and browser based testing we use cypress.js
// adjust as necessary
describe('The app', function() {
it('should load', function() {
// Go to app start page
cy.visit('/app/index.html')
})Context (please always complete the following information):
Build: eXist-6.2.0
Java: 1.8.0_362 (Azul Systems, Inc.)
OS: Mac OS X 12.6.3 (aarch64)
App Version: 3.5.0
Additional context
- How is eXist-db installed? built from source
- Any custom changes in e.g.
conf.xml? none