File tree 2 files changed +6
-3
lines changed
pytiled_parser/parsers/tmx
2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -12,11 +12,10 @@ def parse(raw_properties: etree.Element) -> Properties:
12
12
for raw_property in raw_properties .findall ("property" ):
13
13
type_ = raw_property .attrib .get ("type" )
14
14
15
- if "value" not in raw_property .attrib :
15
+ value_ = raw_property .attrib .get ("value" , raw_property .text )
16
+ if value_ is None :
16
17
continue
17
18
18
- value_ = raw_property .attrib ["value" ]
19
-
20
19
if type_ == "file" :
21
20
value = Path (value_ )
22
21
elif type_ == "color" :
Original file line number Diff line number Diff line change 129
129
<property name="float property" type="float" value="42.1"/>
130
130
<property name="int property" type="int" value="8675309"/>
131
131
<property name="string property" value="pytiled_parser rulez!1!!"/>
132
+ <property name="multiline string property">Hi
133
+ I can write multiple lines in here
134
+ That's pretty great</property>
132
135
</properties>
133
136
</object>
134
137
""" ,
144
147
"float property" : 42.1 ,
145
148
"int property" : 8675309 ,
146
149
"string property" : "pytiled_parser rulez!1!!" ,
150
+ "multiline string property" : "Hi\n I can write multiple lines in here\n That's pretty great" ,
147
151
},
148
152
),
149
153
),
You can’t perform that action at this time.
0 commit comments