summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2021-02-22 14:35:22 -0700
committerDan Allen <dan.j.allen@gmail.com>2021-02-22 14:35:22 -0700
commiteee088d3ac4beb4e70e3053163cc6386de7baa92 (patch)
tree2e92114239e07cffd2a7b95bea1de13cd983844e
parentf8686c841efda961d5f904763bba7a1867914fda (diff)
verify spaces can be used in super and subscript if escaped
- escaped using a attribute reference - escaped by enclosing text in a passthrough
-rw-r--r--test/substitutions_test.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/substitutions_test.rb b/test/substitutions_test.rb
index a69484d8..f097635a 100644
--- a/test/substitutions_test.rb
+++ b/test/substitutions_test.rb
@@ -505,6 +505,16 @@ context 'Substitutions' do
assert_equal para.source, para.sub_quotes(para.source)
end
+ test 'allow spaces in superscript if spaces are inserted using an attribute reference' do
+ para = block_from_string 'Night ^A{sp}poem{sp}by{sp}Jane{sp}Kondo^.'
+ assert_equal 'Night <sup>A poem by Jane Kondo</sup>.', para.apply_subs(para.source)
+ end
+
+ test 'allow spaces in superscript if text is wrapped in a passthrough' do
+ para = block_from_string 'Night ^+A poem by Jane Kondo+^.'
+ assert_equal 'Night <sup>A poem by Jane Kondo</sup>.', para.apply_subs(para.source)
+ end
+
test 'does not match adjacent superscript chars' do
para = block_from_string 'a ^^ b'
assert_equal 'a ^^ b', para.sub_quotes(para.source)