File tree 1 file changed +5
-7
lines changed
lib/treat/entities/entity
1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -58,31 +58,29 @@ def inspect
58
58
end
59
59
60
60
# Helper method to implode the string value of the subtree.
61
- def implode
61
+ def implode ( value = "" )
62
62
63
63
return @value . dup if !has_children?
64
64
65
- value = ''
66
-
67
65
each do |child |
68
66
69
67
if child . is_a? ( Treat ::Entities ::Section )
70
- value += "\n \n "
68
+ value << "\n \n "
71
69
end
72
70
73
71
if child . is_a? ( Treat ::Entities ::Token ) || child . value != ''
74
72
if child . is_a? ( Treat ::Entities ::Punctuation ) ||
75
73
child . is_a? ( Treat ::Entities ::Enclitic )
76
74
value . strip!
77
75
end
78
- value += child . to_s + ' '
76
+ value << child . to_s + ' '
79
77
else
80
- value += child . implode
78
+ child . implode ( value )
81
79
end
82
80
83
81
if child . is_a? ( Treat ::Entities ::Title ) ||
84
82
child . is_a? ( Treat ::Entities ::Paragraph )
85
- value += "\n \n "
83
+ value << "\n \n "
86
84
end
87
85
88
86
end
You can’t perform that action at this time.
0 commit comments