summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2019-02-24 03:58:58 -0700
committerDan Allen <dan.j.allen@gmail.com>2019-02-24 03:59:47 -0700
commitec0deb9dfa1dbdf754f7eff62c6e43d16c5d10de (patch)
tree9738032856c44d482f6a9e74b3bc0bdea693f0ee /test
parentd9db048f784fb60bcceac97eaf1908ecd9ba7993 (diff)
only map unparsed attrlist of inline macro to target when format is short
Diffstat (limited to 'test')
-rw-r--r--test/extensions_test.rb21
-rw-r--r--test/links_test.rb2
2 files changed, 21 insertions, 2 deletions
diff --git a/test/extensions_test.rb b/test/extensions_test.rb
index 4825b9bc..2969386c 100644
--- a/test/extensions_test.rb
+++ b/test/extensions_test.rb
@@ -1128,7 +1128,26 @@ context 'Extensions' do
inline_macro do
named :label
with_format :short
- resolves_attributes false
+ parses_content_as :text
+ process do |parent, _, attrs|
+ %(<label>#{attrs['text']}</label>)
+ end
+ end
+ end
+
+ output = convert_string_to_embedded 'label:[Checkbox]'
+ assert_includes output, '<label>Checkbox</label>'
+ ensure
+ Asciidoctor::Extensions.unregister_all
+ end
+ end
+
+ test 'should map unparsed attrlist to target when format is short' do
+ begin
+ Asciidoctor::Extensions.register do
+ inline_macro do
+ named :label
+ with_format :short
process do |parent, target|
%(<label>#{target}</label>)
end
diff --git a/test/links_test.rb b/test/links_test.rb
index bf2615df..431ad43e 100644
--- a/test/links_test.rb
+++ b/test/links_test.rb
@@ -860,7 +860,7 @@ context 'Links' do
assert_nil ref.reftext
end
- test 'wip anchor with label creates reference' do
+ test 'anchor with label creates reference' do
doc = document_from_string '[[tigers,Tigers]]Tigers roam here.'
ref = doc.catalog[:refs]['tigers']
refute_nil ref