summaryrefslogtreecommitdiff
path: root/test/reader_test.rb
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2023-04-15 23:50:20 -0600
committerDan Allen <dan.j.allen@gmail.com>2023-04-16 02:50:34 -0600
commit7940fc444f0c15dab6705d15cdbdc786e0e5f11f (patch)
tree065383004370675f750861be35029c05e450146d /test/reader_test.rb
parentb56eca8be9fe3f9a25065dc7402713d08323a9ab (diff)
don't allow target of include directive to start or end with a space
Diffstat (limited to 'test/reader_test.rb')
-rw-r--r--test/reader_test.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/reader_test.rb b/test/reader_test.rb
index 1a933544..8c0f18a5 100644
--- a/test/reader_test.rb
+++ b/test/reader_test.rb
@@ -779,6 +779,14 @@ class ReaderTest < Minitest::Test
end
end
+ test 'include directive should not match if target is empty or starts or ends with space' do
+ ['include::[]', 'include:: []', 'include:: not-include[]', 'include::not-include []'].each do |input|
+ doc = Asciidoctor::Document.new input
+ reader = doc.reader
+ assert_equal input, reader.read_line
+ end
+ end
+
test 'include directive should not attempt to resolve target as remote if allow-uri-read is set and URL is not on first line' do
using_memory_logger do |logger|
input = <<~'EOS'