summary refs log tree commit diff
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2008-09-21 00:41:12 +0200
committerChristian Neukirchen <chneukirchen@gmail.com>2008-09-21 00:41:12 +0200
commita5b348806458057f2e76f648e9a2d339c5a27614 (patch)
treee575a9ae6884d806da89ebffd71ffb5cf7ed3025
parent8d669d2263bdcfb870a0f734de9fe7c76e2ec266 (diff)
downloadtrivium-a5b348806458057f2e76f648e9a2d339c5a27614.tar.gz
trivium-a5b348806458057f2e76f648e9a2d339c5a27614.tar.xz
trivium-a5b348806458057f2e76f648e9a2d339c5a27614.zip
More strict entry parsing
-rw-r--r--trivium.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/trivium.rb b/trivium.rb
index 23d76a8..5a6462d 100644
--- a/trivium.rb
+++ b/trivium.rb
@@ -18,7 +18,7 @@ end
 def parse(f)
   head, body = File.read(f).split("\n\n", 2)  rescue (return nil)
   entry = {:body => body, :id => File.basename(f, ".entry"), :file => f}
-  head.scan(/(\w+):\s*(.*)/) { entry[$1.downcase.to_sym] = $2 }
+  head.scan(/(\w+): *(.*)/) { entry[$1.downcase.to_sym] = $2 }
   entry[:date] = Time.parse(entry[:date])  if entry[:date]
   entry[:title] = entry[:date].strftime("%d%b%Y").downcase  if entry[:date]
   entry