diff options
| author | Dan Allen <dan.j.allen@gmail.com> | 2016-11-29 23:39:14 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-11-29 23:39:14 -0700 |
| commit | 282221b2bca816fe1e710277404a036791c774df (patch) | |
| tree | 580cf3c516f159d5fc8bd95668b7e77c418e058e /test | |
| parent | 9af70bd960a4eecc6b6cddb8bba49ebff823474b (diff) | |
resolves #1943 allow spaces in target of block image (PR #1947)
- allow spaces in target of block image
- URL encode spaces in image URI (replace space with %20)
- add test
Diffstat (limited to 'test')
| -rw-r--r-- | test/blocks_test.rb | 11 | ||||
| -rw-r--r-- | test/paths_test.rb | 4 |
2 files changed, 15 insertions, 0 deletions
diff --git a/test/blocks_test.rb b/test/blocks_test.rb index 36f36d93..a5e174f1 100644 --- a/test/blocks_test.rb +++ b/test/blocks_test.rb @@ -1562,6 +1562,17 @@ image::images/tiger.png[A [Bengal\\] Tiger] assert_equal 'A [Bengal] Tiger', img.attr('alt').value end + test 'can render block image with target containing spaces' do + input = <<-EOS +image::images/big tiger.png[A Big Tiger] + EOS + + output = render_string input + img = xmlnodes_at_xpath '//img', output, 1 + assert_equal 'images/big%20tiger.png', img.attr('src').value + assert_equal 'A Big Tiger', img.attr('alt').value + end + test 'can render block image with alt text defined in block attribute above macro' do input = <<-EOS [Tiger] diff --git a/test/paths_test.rb b/test/paths_test.rb index bf9f73b4..f7fd96c2 100644 --- a/test/paths_test.rb +++ b/test/paths_test.rb @@ -95,6 +95,10 @@ context 'Path Resolver' do assert_equal 'assets/images', @resolver.web_path('assets\\images') assert_equal '../assets/images', @resolver.web_path('assets\\images', '..\\images\\..') end + + test 'URL encode spaces in path' do + assert_equal 'assets%20and%20stuff/lots%20of%20images', @resolver.web_path('lots of images', 'assets and stuff') + end end context 'System Paths' do |
