summaryrefslogtreecommitdiffstats
path: root/hugolib/shortcode_test.go
diff options
context:
space:
mode:
authorKaushal Modi <kaushal.modi@gmail.com>2017-10-27 11:37:54 -0400
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2017-10-29 20:46:57 +0100
commit488631fe0abc3667355345c7eb98ba7a2204deb5 (patch)
tree13dc897505ae31a7bddd779e31d626491c813001 /hugolib/shortcode_test.go
parentfdd62eb4c3dab9229ae4b7aeae45832961f6e168 (diff)
Add support for height argument to figure shortcode
Fixes #4014
Diffstat (limited to 'hugolib/shortcode_test.go')
-rw-r--r--hugolib/shortcode_test.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/hugolib/shortcode_test.go b/hugolib/shortcode_test.go
index ab2d1f334..ba0d43c65 100644
--- a/hugolib/shortcode_test.go
+++ b/hugolib/shortcode_test.go
@@ -299,6 +299,16 @@ func TestFigureImgWidth(t *testing.T) {
CheckShortCodeMatch(t, `{{% figure src="/found/here" class="bananas orange" alt="apple" width="100px" %}}`, "\n<figure class=\"bananas orange\">\n \n <img src=\"/found/here\" alt=\"apple\" width=\"100px\" />\n \n \n</figure>\n", nil)
}
+func TestFigureImgHeight(t *testing.T) {
+ t.Parallel()
+ CheckShortCodeMatch(t, `{{% figure src="/found/here" class="bananas orange" alt="apple" height="100px" %}}`, "\n<figure class=\"bananas orange\">\n \n <img src=\"/found/here\" alt=\"apple\" height=\"100px\" />\n \n \n</figure>\n", nil)
+}
+
+func TestFigureImgWidthAndHeight(t *testing.T) {
+ t.Parallel()
+ CheckShortCodeMatch(t, `{{% figure src="/found/here" class="bananas orange" alt="apple" width="50" height="100" %}}`, "\n<figure class=\"bananas orange\">\n \n <img src=\"/found/here\" alt=\"apple\" width=\"50\" height=\"100\" />\n \n \n</figure>\n", nil)
+}
+
const testScPlaceholderRegexp = "HAHAHUGOSHORTCODE-\\d+HBHB"
func TestExtractShortcodes(t *testing.T) {