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

Add CDATA escaping to exml #73

Merged
merged 5 commits into from
Dec 20, 2024
Merged

Add CDATA escaping to exml #73

merged 5 commits into from
Dec 20, 2024

Conversation

NelsonVides
Copy link

Expose a way to select cdata to be printed as an escaped string or as a CDATA[] section. The latter can make the string considerably smaller when there is a lot of information that needs to be escaped, for example when printing URLs.

So that this package:

<name>
  <![CDATA[{"one":1,"two":"bis","three":["raz","dwa","trzy"]}]]>
</name>

Doesn’t become this one when printing (which is not only unreadable but also bigger):

<name>
  {&quot;one&quot;:1,&quot;three&quot;:[&quot;raz&quot;,&quot;dwa&quot;,&quot;trzy&quot;],&quot
;two&quot;:&quot;bis&quot;}
</name>

@codecov-commenter
Copy link

codecov-commenter commented Dec 17, 2024

Codecov Report

Attention: Patch coverage is 72.41379% with 8 lines in your changes missing coverage. Please review.

Project coverage is 73.94%. Comparing base (79e0f21) to head (70328df).

Files with missing lines Patch % Lines
c_src/rapidxml_print.hpp 40.00% 6 Missing ⚠️
c_src/exml.cpp 88.23% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #73      +/-   ##
==========================================
+ Coverage   72.20%   73.94%   +1.73%     
==========================================
  Files           7        7              
  Lines        1173     1182       +9     
  Branches      167      169       +2     
==========================================
+ Hits          847      874      +27     
+ Misses        326      308      -18     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

@JanuszJakubiec JanuszJakubiec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍🏻

@JanuszJakubiec JanuszJakubiec merged commit 50100b5 into master Dec 20, 2024
3 checks passed
@JanuszJakubiec JanuszJakubiec deleted the cdata branch December 20, 2024 12:05
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

Successfully merging this pull request may close these issues.

3 participants