summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2017-07-19 00:18:12 -0600
committerDan Allen <dan.j.allen@gmail.com>2017-07-19 00:18:12 -0600
commitb972c9de2b3eeb3539f6cf22fd5ff8341bfbbc5c (patch)
treec5f344e40da6943cc4eb545cf78e555e1077c159
parente58beba7d621cdc85baf7d9d3bf0644ddf4cde3b (diff)
add missing scenario when parsing revision info line
-rw-r--r--lib/asciidoctor.rb2
-rw-r--r--test/document_test.rb15
2 files changed, 16 insertions, 1 deletions
diff --git a/lib/asciidoctor.rb b/lib/asciidoctor.rb
index 77c305b6..f6812b3e 100644
--- a/lib/asciidoctor.rb
+++ b/lib/asciidoctor.rb
@@ -434,7 +434,7 @@ module Asciidoctor
# v1.0, 2013-01-01: Ring in the new year release
# 1.0, Jan 01, 2013
#
- RevisionInfoLineRx = /^(?:\D*(.*?),)? *(?!:)(.*?)(?: *(?!^): *(.*))?$/
+ RevisionInfoLineRx = /^(?:\D*(.*?),)? *(?!:)(.*?)(?: *(?!^),?: *(.*))?$/
# Matches the title and volnum in the manpage doctype.
#
diff --git a/test/document_test.rb b/test/document_test.rb
index eaebf2be..07a9d0df 100644
--- a/test/document_test.rb
+++ b/test/document_test.rb
@@ -1434,6 +1434,21 @@ more info...
assert_xpath '//*[@id="header"]/*[@class="details"]/span[@id="revremark"][text() = "See changelog."]', output, 1
end
+ test 'should parse revision line if date is empty' do
+ input = <<-EOS
+= Document Title
+Author Name
+v1.0.0,:remark
+
+content
+ EOS
+
+ doc = document_from_string input
+ assert_equal '1.0.0', doc.attributes['revnumber']
+ assert_nil doc.attributes['revdate']
+ assert_equal 'remark', doc.attributes['revremark']
+ end
+
test 'should include revision history if revdate and revnumber is set' do
input = <<-EOS
= Document Title