Skip to content

Images: pick the largest srcset candidate and keep caption formatting - #409

Open
lagudafuadtosin wants to merge 1 commit into
kepano:mainfrom
lagudafuadtosin:picture-srcset-figcaption
Open

lagudafuadtosin wants to merge 1 commit into
kepano:mainfrom
lagudafuadtosin:picture-srcset-figcaption

Conversation

@lagudafuadtosin

Copy link
Copy Markdown

Two fixes in src/elements/images.ts.

#406: <picture> set img src to the first (smallest) srcset candidate.
It now picks the largest, full srcset kept.

#369: figcaption flattened to plain text, dropping links and footnote refs.
Sorted, keeps the caption's inline HTML.

Test covers both, fails before and passes after.

…n captions

Two fixes in the <picture>/<figure> standardization path:

- <picture> set img src to the first srcset candidate, which is usually the
  smallest. Markdown keeps a single src, so pick the largest width/density
  candidate instead (kepano#406).
- figcaption content was flattened to plain text, dropping links and footnote
  references. Preserve the caption's inline HTML (kepano#369).

Adds a test covering both, failing before and passing after.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant