Skip to content

Markdown syntax and figure shortcode generate slightly different HTML #1063

@PJBaker

Description

@PJBaker

Issue description

According to #828, Markdown syntax (![Alt text](image.jpg "Image caption")) and the figure shortcode ({{< figure src="image.jpg" alt="Alt text" caption="Image caption" >}}) should generate the same HTML, but they don't quite.

render-image.html contains <figure>, whereas figure.html uses <figure{{ with $class }} class="{{ . }}"{{ end }}>. Both handle class in the same way otherwise, passing it on to the picture.html partial or <img> tag.

Perhaps it would be easier to keep them consistent by implementing render-image.html in terms of the figure shortcode, instead of directly in terms of picture and <img>?

I hope it's helpful to report tiny issues like this. Overall I'm really happy with the Congo theme - thanks for all the great work!

Theme version

Latest

Hugo version

hugo v0.139.3+extended windows/amd64

Which browser rendering engines are you seeing the problem on?

Chromium (Google Chrome, Microsoft Edge, Brave, Vivaldi, Opera, etc.), Firefox (Mozilla Firefox)

URL to sample repository or website

No response

Hugo output or build error messages

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingquestionFurther information is requestedstaleThis issue or pull request has not had any recent activity

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions