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

Feat: add support for image title #244

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

tripodsan
Copy link
Contributor

  • added support to retain the image title
  • the Image node contains the title from the original image title and the altText from the image description.
  • it is backward compatible such as if the description is missing, the title is used as alt text.

@tripodsan
Copy link
Contributor Author

Hi @mwilliamson, do you have time to look at this?

@tripodsan
Copy link
Contributor Author

Hi @mwilliamson, any update?

@mwilliamson
Copy link
Owner

I believe both the descr and title attributes are for alt text. For instance, there's a post from 2014 that goes through the different cases with different applications and formats. From the Microsoft docs for Word before 2019:

In the Description box, enter an explanation of the shape, picture, chart, PivotTable, SmartArt graphic, or other object. This box should always be filled in.

If you want, in the Title box, enter a brief summary. This box should only be filled in if you are entering a detailed or long explanation in the Description box.

It seems like both attributes map to the HTML notion of alt text rather than a title. If the attributes are used as described above, it seems like you can either get a short description (by getting the title if set, the description otherwise) or a full description (by getting the description). I'm not sure the title on its own is meaningful, nor intended to have the same meaning as the HTML notion of a title.

@tripodsan
Copy link
Contributor Author

tripodsan commented Jul 7, 2020

ok. fair point. but I think it would be beneficial to retain the title information, so the HTML transformer can still decide what to do with it. for example use it as aria-label.

what about we add the title and the description as extra property on the image node?

btw: when converting to markdown, being able to support the title would also be beneficial:
https://daringfireball.net/projects/markdown/syntax#img

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.

3 participants