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

Handle Tree.toXML to return proper XML string #805

Merged
merged 13 commits into from
May 10, 2024
Merged

Conversation

raararaara
Copy link
Contributor

@raararaara raararaara commented May 9, 2024

What this PR does / why we need it?

When attempting to directly convert the object resulting from JSON.parse() into a string during the toXML() process for RHT, issues may arise. The conversion of the object to a string may result in an output such as [object Object], which needs to be addressed. This PR handles the conversion of objects to strings to prevent unexpected results.

Any background context you want to provide?

In the toXML() process for RHT, the value obtained from JSON.parse() was directly converted to a string. This conversion led to undesired outcomes when the object contained in the value was transformed into the string [object Object]. To mitigate this issue, adjustments were made to properly handle the conversion of objects to strings.

What are the relevant tickets?

Fixes #

Checklist

  • Added relevant tests or not required
  • Didn't break anything

hackerwins and others added 3 commits May 9, 2024 15:13
Generate TreeChangeType.Style events by filtering out only the affected
properties.
Copy link

codecov bot commented May 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.74%. Comparing base (f765d1c) to head (0c4c764).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #805      +/-   ##
==========================================
+ Coverage   80.67%   80.74%   +0.06%     
==========================================
  Files          59       59              
  Lines        4476     4481       +5     
  Branches      908      908              
==========================================
+ Hits         3611     3618       +7     
  Misses        601      601              
+ Partials      264      262       -2     

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In 'concurrently-edit-style-test', the result of first test case was as follows, so I handled an exception for the case where it is not a nested object, that is, 'string'. I am wondering if there is a better way.

const initialXML = `<r><p color="red">a</p><p color="red">b</p><p color="red">c</p></r>`;

Expected :<r><p color="red">a</p><p color="red">b</p><p color="red">c</p></r>
Actual   :<r><p color="\"red\"">a</p><p color="\"red\"">b</p><p color="\"red\"">c</p></r>

@raararaara raararaara marked this pull request as ready for review May 10, 2024 07:04
@raararaara raararaara changed the title Fix errors when styling Tree Handle RHT.toXML to return proper XML string May 10, 2024
Copy link
Member

@hackerwins hackerwins left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution.

@hackerwins hackerwins changed the title Handle RHT.toXML to return proper XML string Handle Tree.toXML to return proper XML string May 10, 2024
@hackerwins hackerwins merged commit 555d5ad into main May 10, 2024
2 checks passed
@hackerwins hackerwins deleted the handle-concurrent-style branch May 10, 2024 10:59
hackerwins pushed a commit to yorkie-team/yorkie that referenced this pull request May 13, 2024
@coderabbitai coderabbitai bot mentioned this pull request May 24, 2024
2 tasks
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.

None yet

2 participants