Skip to content

Commit

Permalink
ChorE: support empty alt tags
Browse files Browse the repository at this point in the history
  • Loading branch information
franciscofsales authored and Daniel15 committed Jul 21, 2019
1 parent fe90e73 commit 3b14406
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/htmltojsx.js
Expand Up @@ -38,7 +38,6 @@ var ELEMENT_ATTRIBUTE_MAPPING = {
// Reference: https://developer.mozilla.org/en-US/docs/Web/SVG/Element#SVG_elements
var ELEMENT_TAG_NAME_MAPPING = {
a: 'a',
alt: 'alt',
altglyph: 'altGlyph',
altglyphdef: 'altGlyphDef',
altglyphitem: 'altGlyphItem',
Expand Down Expand Up @@ -628,6 +627,8 @@ HTMLtoJSX.prototype = {
result += '={' + attribute.value + '}';
} else if (attribute.value.length > 0) {
result += '="' + attribute.value.replace(/"/gm, '"') + '"';
} else if(attribute.value.length === 0 && attribute.name === 'alt') {
result += '=""';
}
return result;
}
Expand Down

0 comments on commit 3b14406

Please sign in to comment.