Skip to content
Permalink
Browse files

ChorE: support empty alt tags

  • Loading branch information...
franciscofsales authored and Daniel15 committed Jun 14, 2019
1 parent fe90e73 commit 3b14406a1dbd243f239d559951e03d4337d4d71f
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/htmltojsx.js
@@ -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',
@@ -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;
}

0 comments on commit 3b14406

Please sign in to comment.
You can’t perform that action at this time.