From 420babf0029df88cfebdc4ea26200026c65098c9 Mon Sep 17 00:00:00 2001 From: Dan Allen Date: Sat, 9 Feb 2019 23:10:00 -0700 Subject: resolves #3060 require setext section title to have at least one alphanumeric character (PR #3061) - although documented this way, the parser was checking for at least one word character, which is different --- test/sections_test.rb | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'test/sections_test.rb') diff --git a/test/sections_test.rb b/test/sections_test.rb index a2c04c4f..ddfabebe 100644 --- a/test/sections_test.rb +++ b/test/sections_test.rb @@ -528,6 +528,30 @@ context 'Sections' do assert_includes result, '----^^----' end + test 'should not recognize section title that does not contain alphanumeric character' do + input = <<~'EOS' + !@#$ + ---- + EOS + + using_memory_logger do |logger| + result = convert_string_to_embedded input + assert_css 'h2', result, 0 + end + end + + test 'should not recognize section title that consists of only underscores' do + input = <<~'EOS' + ____ + ---- + EOS + + using_memory_logger do |logger| + result = convert_string_to_embedded input + assert_css 'h2', result, 0 + end + end + test 'should preprocess second line of setext section title' do input = <<~'EOS' Section Title -- cgit v1.2.3