Make img alt information available

Open
#112 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
30/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
php

Research direction

Start by reading the mf2 parsing path that turns image properties into XRay output, then inspect the JF2 representation and its specification, which the issue links. Compare the proposed img+alt and indexed-list options and establish which representation should be used before making changes. Done means consumers can access image alt text without breaking existing output; verify with relevant parser and output tests.

Written by the indexing model from the issue text.

Description

Currently, when parsing mf2 data which includes alt information for properties parsed from images, XRay has no way of making the alt information available to library consumers.

This might additionally be a JF2 issue, as the current spec doesn’t mention image alt values at all https://jf2.spec.indieweb.org/

Potential solutions which come to mind:

  • Provide img+alt structures where alt information is available, forcing consumers to check whether every image-based property is a string or img+alt array before consuming (breaks existing code)
  • Provide img+alt structures by default on every property which is parsed as an image, with empty alt values if none is found. Breaks existing code but is more consistent.
  • Use either the ref(erences) list or a new “alts” list on jf2 objects to provide the alt value, indexed by the image URL. This would not break any existing code afaik
Dominant language
PHP
Stars
96
Forks
17
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from aaronpk/XRay

All issues in aaronpk/XRay

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.