lib/hershey/document.rb in hershey-0.0.5 vs lib/hershey/document.rb in hershey-0.0.6
- old
+ new
@@ -25,16 +25,16 @@
def <<(text)
word = ""
text.each_char do |c|
if c == " "
- @words << :space
@words << Word.new(word, font: @font)
word = ''
+ @words << :space
elsif c == "\n"
- @words << :break
@words << Word.new(word, font: @font)
word = ''
+ @words << :break
else
word << c
end
end
@words << Word.new(word, font: @font) unless word == ''