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

Allow empty alt attribute in markdown editor images #828

Closed
verythorough opened this issue Nov 17, 2017 · 0 comments · Fixed by #829
Closed

Allow empty alt attribute in markdown editor images #828

verythorough opened this issue Nov 17, 2017 · 0 comments · Fixed by #829
Assignees

Comments

@verythorough
Copy link
Contributor

- Do you want to request a feature or report a bug?
bug

- What is the current behavior?
Empty alt attributes in markdown images in the editor are replaced with undefined or null.
![](/path/to/img.jpg) becomes ![undefined](/path/to/img/jpg)

- If the current behavior is a bug, please provide the steps to reproduce.

For images added in rich text mode:

  1. Add an image block to the markdown editor. Select an image, leave the alt field blank, and save.
  2. Check the updated file and find [undefined] in the resulting markdown. If you're using the cms-demo site (and can't check for a changed file), you can see the result by switching to markdown mode.

For images added in markdown mode:

  1. In markdown mode in the editor, add a markdown image tag with empty []
  2. If you save without ever switching to rich text mode, it will stay, but if you switch to rich text mode for any reason, even on later edits, you fill find the tag now has [null] for the alt.

- What is the expected behavior?
To clarify, it's invalid html to have no alt attribute at all, but blank alt attributes (i.e. alt="") are actually the recommended practice for decorative images. Screen readers will skip images with empty alt attributes, but they'll read 'undefined' aloud, and that's not helping anyone.

- Please mention your CMS, node.js, and operating system version.
Reproduced in CMS 0.7.2, as well as preview/branch deploys of the new UI. Tested on Windows 10 and Mac OS. Tested in Chrome only so far.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants