Skip to content

Commit 6865a09

Browse files
author
Malte Legenhausen
committed
Merge pull request #7 from benjaminma/fix-ucase-tag
Uppercase/mixedcase tag support for walk() function [new]
2 parents 37f5f1c + 5f52f95 commit 6865a09

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/html-to-text.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ function walk(dom, options) {
7070
_.each(dom, function(elem) {
7171
switch(elem.type) {
7272
case 'tag':
73-
switch(elem.name) {
73+
switch(elem.name.toLowerCase()) {
7474
case 'a':
7575
result += format.anchor(elem, walk, options);
7676
break;
@@ -127,4 +127,4 @@ exports.fromFile = function(file, options, callback) {
127127

128128
exports.fromString = function(str, options) {
129129
return htmlToText(str, options || {});
130-
};
130+
};

0 commit comments

Comments
 (0)