Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CData encoding chars when it should not #10

Open
bib1963 opened this issue May 7, 2019 · 1 comment
Open

CData encoding chars when it should not #10

bib1963 opened this issue May 7, 2019 · 1 comment
Assignees

Comments

@bib1963
Copy link

bib1963 commented May 7, 2019

I need a cdata section which contains ecmascript.

It contains the greater & less than signs, <> amongst others.

When printing, these get mangled into their html id's, < >

This is wrong. the cdata section should not be encoding these or any other characters.

As is, this breaks the ecmascript.

If this encoding is required, it should be enabled via a switch, and should not happen as default.

@bib1963
Copy link
Author

bib1963 commented May 8, 2019

FWIW, this small patch did it for me...

`diff --git a/dom/dom-core-nodes.adb b/dom/dom-core-nodes.adb
index 451a43e..1b2bdf3 100644
--- a/dom/dom-core-nodes.adb
+++ b/dom/dom-core-nodes.adb
@@ -1487,6 +1487,14 @@ package body DOM.Core.Nodes is
end;
end if;

  •        when Cdata_Section_Node =>
    
  •           Put (Stream, "<![CDATA[", Encoding);
    
  •           Newline;
    
  •           Put (Stream, Node_Value (N), Encoding);
    
  •           Newline;
    
  •           Put (Stream, "]]>", Encoding);
    
  •           Newline;
    
  •        when others =>
              Print_String (Stream, Node_Value (N), EOL_Sequence, Encoding);
        end case;
    

`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants