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

Whitespace between elements leads to duplication and deletion of text nodes #1191

Open
NTsch opened this issue Jan 15, 2025 · 2 comments
Open
Labels
Milestone

Comments

@NTsch
Copy link
Collaborator

NTsch commented Jan 15, 2025

Certain whitespace is not recognized as such by the editor. For example, the following XML is fine:

<cei:tenor><cei:pTenor>paragraph with text</cei:pTenor>text after paragraph</cei:tenor>

However, if a space or line break is introduced between the opening tags ...

<cei:tenor> <cei:pTenor>paragraph with text</cei:pTenor>text after paragraph</cei:tenor>

... this is not recognized as a text node by the editor window, but is recognized for the counting of the contextId in updateTextNode (if I interpret this correctly). As a result, any change to 'text after paragraph' is inserted into this empty node:

<cei:tenor>text after paragraph 123<cei:pTenor>paragraph with text</cei:pTenor>text after paragraph</cei:tenor>

This is not specific to any element, and appears to happen wherever there is mixed content with whitespace between mixed element tags.

@NTsch NTsch added the bug label Jan 15, 2025
@GVogeler
Copy link
Collaborator

related to #685 and #366 ?

@GVogeler GVogeler added this to the EditMOM3 milestone Jan 15, 2025
@NTsch
Copy link
Collaborator Author

NTsch commented Jan 24, 2025

Most immediate conclusion would be to simply avoid adding any unnecessary whitespace into charter files, such as e.g. automatic formatting & indenting.

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

No branches or pull requests

2 participants