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 support for multiline string properties #110

Merged
merged 2 commits into from
Dec 26, 2021

Conversation

PieKing1215
Copy link
Member

@PieKing1215 PieKing1215 commented Dec 26, 2021

If you enter a multiline string into a string property in the editor, it saves the string inside the xml node instead of inside the "value" attribute:

<property name="prop3">Line 1
Line 2
Line 3,
  etc
   </property>

which should be parsed as:

"Line 1\r\nLine 2\r\nLine 3,\r\n  etc\r\n   "

(I believe Tiled saves the file with the system's native line endings right? Not sure if the parsing in this PR should normalize it)

This PR adds support for parsing multiline strings like this.
It also adds such a property to the test files and adds a test to check that it works.

(feel free to suggest changes)

Copy link
Contributor

@aleokdev aleokdev 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!

@aleokdev aleokdev merged commit 7585b49 into mapeditor:master Dec 26, 2021
@bjorn
Copy link
Member

bjorn commented Dec 27, 2021

(I believe Tiled saves the file with the system's native line endings right? Not sure if the parsing in this PR should normalize it)

Doesn't that happen automatically depending on whether the file is opened in text mode? That's what happens in Tiled at least, but it might be as a result of using Qt.

@aleokdev aleokdev mentioned this pull request Dec 28, 2021
@aleokdev
Copy link
Contributor

aleokdev commented Dec 28, 2021

Not sure if the parsing in this PR should normalize it

Didn't notice this, it'd be better if you could normalize line endings from code

@PieKing1215 PieKing1215 deleted the multiline-string branch December 30, 2021 00:12
@aleokdev aleokdev added this to the 0.10.0 milestone Mar 7, 2022
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

3 participants