Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

why Extra newlines added after render image hook #12738

Closed
toyo2333 opened this issue Aug 9, 2024 · 1 comment
Closed

why Extra newlines added after render image hook #12738

toyo2333 opened this issue Aug 9, 2024 · 1 comment

Comments

@toyo2333
Copy link

toyo2333 commented Aug 9, 2024

there are the contents in render-image.html

{{ if site.Params.replacefunc.enable }}
    {{ if hugo.IsServer }}
<p class="md__image">
    <img src='{{ .Destination | safeURL }}' alt="{{ .Text }}" {{ with .Title }} title="{{ . }}" {{ end }} />
</p>
    {{ else }}
        {{ $image_ext := replaceRE ".*\\.([^.]+)$" "$1" .Destination }}
        {{ if in site.Params.replacefunc.convertTypeList (lower $image_ext) }}
            {{ $img_abs_src := "" }}

			{{ some logic code }}
			{{ some logic code }}
			{{ some logic code }}
			{{ some logic code }}
			{{ some logic code }}

<p class="md__image">
    <img src='{{ $img_abs_src| safeURL }}' alt="{{ .Text }}" {{ with .Title }} title="{{ . }}" {{ end }} />
</p>
        {{ else }}
<p class="md__image">
    <img src='{{ .Destination | safeURL }}' alt="{{ .Text }}" {{ with .Title }} title="{{ . }}" {{ end }} />
</p>
        {{ end }}
    {{ end }}
{{ else }}
<p class="md__image">
    <img src='{{ .Destination | safeURL }}' alt="{{ .Text }}" {{ with .Title }} title="{{ . }}" {{ end }} />
</p>
{{ end }}

bughook

hugo version : 0.131.0

@bep
Copy link
Member

bep commented Aug 9, 2024

Thanks for getting in touch, but it feels like this is a question that would be better suited to the Hugo Discussion Forum. We prefer to use GitHub issues only for bugs and enhancements. Feel free to update this issue with a link to the re-posted question (so that other people can find it) or add some more details if you feel this is a genuine bug. You may also find the answers you search for in Hugo Documentation.

@bep bep closed this as completed Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants