diff options
author | Kaushal Modi <kaushal.modi@gmail.com> | 2018-02-05 14:06:29 -0500 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2018-02-09 22:27:58 +0100 |
commit | 2e95ec6844bf65a25485bdc8e2638e45788f2dcf (patch) | |
tree | 977cee6771f6a45bb446fd40a12afe0453c50d8c /tpl | |
parent | 76d38d5e5322fc6220fb9e74f9ca0668606ebb5d (diff) |
Add "target" and "rel" parameters to figure shortcode
Also:
- Remove unnecessary space from `figure` tag if no class is specified.
- Update related tests.
- Add test cases for the changes made to the figure shortcode.
- Document the newly added target and rel parameters
- Add more detail to the documentation of all figure shortcode parameters.
Diffstat (limited to 'tpl')
-rw-r--r-- | tpl/tplimpl/template_embedded.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tpl/tplimpl/template_embedded.go b/tpl/tplimpl/template_embedded.go index 627d4dc4d..18bba44f2 100644 --- a/tpl/tplimpl/template_embedded.go +++ b/tpl/tplimpl/template_embedded.go @@ -19,8 +19,8 @@ func (t *templateHandler) embedShortcodes() { t.addInternalShortcode("highlight.html", `{{ if len .Params | eq 2 }}{{ highlight (trim .Inner "\n\r") (.Get 0) (.Get 1) }}{{ else }}{{ highlight (trim .Inner "\n\r") (.Get 0) "" }}{{ end }}`) t.addInternalShortcode("test.html", `This is a simple Test`) t.addInternalShortcode("figure.html", `<!-- image --> -<figure {{ with .Get "class" }}class="{{.}}"{{ end }}> - {{ with .Get "link"}}<a href="{{.}}">{{ end }} +<figure{{ with .Get "class" }} class="{{.}}"{{ end }}> + {{ if .Get "link"}}<a href="{{ .Get "link" }}"{{ with .Get "target" }} target="{{ . }}"{{ end }}{{ with .Get "rel" }} rel="{{ . }}"{{ end }}>{{ end }} <img src="{{ .Get "src" }}" {{ if or (.Get "alt") (.Get "caption") }}alt="{{ with .Get "alt"}}{{.}}{{else}}{{ .Get "caption" }}{{ end }}" {{ end }}{{ with .Get "width" }}width="{{.}}" {{ end }}{{ with .Get "height" }}height="{{.}}" {{ end }}/> {{ if .Get "link"}}</a>{{ end }} {{ if or (or (.Get "title") (.Get "caption")) (.Get "attr")}} |