lib/octopress/draft.rb in octopress-3.0.0.rc.11 vs lib/octopress/draft.rb in octopress-3.0.0.rc.12
- old
+ new
@@ -75,20 +75,20 @@
end
# read_draft_date
#
def read_draft_date
- match = read.match(/date:\s+(.+)?$/)
+ match = read.match(/date:\s+(\d.+)$/)
match[1] if match
end
# Get content from draft post file
# also update the draft's date configuration
#
def read_draft_content
if @options['date']
# remove date if it exists
- content = read.sub(/date:\s+.+?\n/, "")
+ content = read.sub(/date:.*$\n/, "")
# Insert date after title
content.sub(/(title:.+$)/i, '\1'+"\ndate: #{@options['date']}")
else
read