summaryrefslogtreecommitdiff
path: root/test/parser_test.rb
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2017-05-07 23:48:22 -0600
committerGitHub <noreply@github.com>2017-05-07 23:48:22 -0600
commit8ae0ce27d43b0cb91077b26b7c8d1075a258239c (patch)
treedadffb5d6b6285568ec381891fa2402ebd4fdacf /test/parser_test.rb
parent83aaa4dbe6c04c251b1ca2ca892ac001563e3545 (diff)
resolves #2112 sanitize content of authors meta tag in HTML output (PR #2181)
- sanitize content of authors meta tag in HTML output - sanitize value of author and authors attribute before partitioning - consolidate author metadata assignment - add tests
Diffstat (limited to 'test/parser_test.rb')
-rw-r--r--test/parser_test.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/parser_test.rb b/test/parser_test.rb
index 89108043..fecf5436 100644
--- a/test/parser_test.rb
+++ b/test/parser_test.rb
@@ -492,6 +492,19 @@ Kismet Chameleon; Johnny Bravo; Lazarus het_Draeke
assert_equal 'het Draeke', doc.attributes['lastname_3']
end
+ test 'removes formatting before partitioning author defined using author attribute' do
+ input = <<-EOS
+:author: pass:n[http://example.org/community/team.html[Ze_**Project** team]]
+ EOS
+
+ doc = empty_document
+ parse_header_metadata input, doc
+ assert_equal 1, doc.attributes['authorcount']
+ assert_equal '<a href="http://example.org/community/team.html">Ze <strong>Project</strong> team</a>', doc.attributes['authors']
+ assert_equal 'Ze Project', doc.attributes['firstname']
+ assert_equal 'team', doc.attributes['lastname']
+ end
+
test "parse rev number date remark" do
input = <<-EOS
Ryan Waldron