lib/dnote/notes.rb in dnote-1.1.1 vs lib/dnote/notes.rb in dnote-1.1.2
- old
+ new
@@ -92,10 +92,14 @@
if text
if line =~ /^\s*[#]{0,1}\s*$/ or line !~ /^\s*#/ or line =~ /^\s*#[+][+]/
text.strip!
text = nil
else
- text << ' ' << line.gsub(/^\s*#\s*/,'')
+ if text[-1,1] == "\n"
+ text << line.gsub(/^\s*#\s*/,'')
+ else
+ text << "\n" << line.gsub(/^\s*#\s*/,'')
+ end
end
end
end
end
end