Skip to content

Commit 3b14406

Browse files
franciscofsalesDaniel15
authored andcommitted
ChorE: support empty alt tags
1 parent fe90e73 commit 3b14406

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: src/htmltojsx.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ var ELEMENT_ATTRIBUTE_MAPPING = {
3838
// Reference: https://developer.mozilla.org/en-US/docs/Web/SVG/Element#SVG_elements
3939
var ELEMENT_TAG_NAME_MAPPING = {
4040
a: 'a',
41-
alt: 'alt',
4241
altglyph: 'altGlyph',
4342
altglyphdef: 'altGlyphDef',
4443
altglyphitem: 'altGlyphItem',
@@ -628,6 +627,8 @@ HTMLtoJSX.prototype = {
628627
result += '={' + attribute.value + '}';
629628
} else if (attribute.value.length > 0) {
630629
result += '="' + attribute.value.replace(/"/gm, '"') + '"';
630+
} else if(attribute.value.length === 0 && attribute.name === 'alt') {
631+
result += '=""';
631632
}
632633
return result;
633634
}

0 commit comments

Comments
 (0)