mirror of
https://github.com/nunocoracao/blowfish.git
synced 2026-01-30 15:31:52 +00:00
Merge pull request #2403 from ZhenShuo2021/fix/figure-link-area
🐛 Fix(figure): limit link hover area to image only
This commit is contained in:
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
<figure{{ with .Get "class" }} class="{{ . }}"{{ end }}>
|
<figure{{ with .Get "class" }} class="{{ . }}"{{ end }}>
|
||||||
{{- if .Get "link" -}}
|
{{- if .Get "link" -}}
|
||||||
<a href="{{ .Get "link" }}"{{ with .Get "target" }} target="{{ . }}"{{ end }}{{ with .Get "rel" }} rel="{{ . }}"{{ end }}>
|
<a href="{{ .Get "link" }}"{{ with .Get "target" }} target="{{ . }}"{{ end }}{{ with .Get "rel" }} rel="{{ . }}"{{ end }} class="inline-block">
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{- $u := urls.Parse (.Get "src") -}}
|
{{- $u := urls.Parse (.Get "src") -}}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
{{- $nozoom := .Get "nozoom" | default false -}}
|
{{- $nozoom := .Get "nozoom" | default false -}}
|
||||||
|
|
||||||
<figure>
|
<figure>
|
||||||
{{- with $href }}<a href="{{ . }}" {{ with $target }}target="{{ . }}"{{ end }}>{{ end -}}
|
{{- with $href }}<a href="{{ . }}" {{ with $target }}target="{{ . }}"{{ end }} class="inline-block">{{ end -}}
|
||||||
{{- if findRE "^https?" $url.Scheme }}
|
{{- if findRE "^https?" $url.Scheme }}
|
||||||
<img class="my-0 rounded-md{{ with $nozoom }} nozoom{{ end }}{{ with $class }} {{ . }}{{ end }}" src="{{ $url.String }}" alt="{{ $altText }}" />
|
<img class="my-0 rounded-md{{ with $nozoom }} nozoom{{ end }}{{ with $class }} {{ . }}{{ end }}" src="{{ $url.String }}" alt="{{ $altText }}" />
|
||||||
{{- else }}
|
{{- else }}
|
||||||
@@ -45,7 +45,7 @@
|
|||||||
<img class="my-0 rounded-md{{ with $nozoom }} nozoom{{ end }}{{ with $class }} {{ . }}{{ end }}" src="{{ $url.String }}" alt="{{ $altText }}" />
|
<img class="my-0 rounded-md{{ with $nozoom }} nozoom{{ end }}{{ with $class }} {{ . }}{{ end }}" src="{{ $url.String }}" alt="{{ $altText }}" />
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{ with $caption }}<figcaption>{{ . | markdownify }}</figcaption>{{ end }}
|
|
||||||
{{ if $href }}</a>{{ end }}
|
{{ if $href }}</a>{{ end }}
|
||||||
|
{{ with $caption }}<figcaption>{{ . | markdownify }}</figcaption>{{ end }}
|
||||||
</figure>
|
</figure>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|||||||
Reference in New Issue
Block a user