Skip to content

Commit 0a0f349

Browse files
missinglinkorangejulius
authored andcommitted
feat(names): remove parenthesed portion of names
1 parent 0ec1829 commit 0a0f349

File tree

3 files changed

+80
-78
lines changed

3 files changed

+80
-78
lines changed

stream/tag_mapper.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ module.exports = function(){
8181

8282
// use one of the preferred name tags listed above
8383
if ( defaultName ){
84-
doc.setName('default', defaultName);
84+
doc.setName('default', trim( defaultName ) );
8585
}
8686

8787
// else try to use an available two-letter language name tag
@@ -128,7 +128,9 @@ module.exports = function(){
128128
};
129129

130130
// Clean string of leading/trailing junk chars
131+
// note: parenthesed text is removed
131132
function trim( str ){
133+
str = str.replace(/\([^)]*\) */g, ''); // remove parenthesed portions of text
132134
return _.trim( str, '#$%^*<>-=_{};:",./?\t\n\' ' );
133135
}
134136

0 commit comments

Comments
 (0)