Skip to content

Commit 16d92d1

Browse files
committed
feat(names): remove parenthesed portion of names
1 parent d952ea4 commit 16d92d1

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
@@ -80,7 +80,7 @@ module.exports = function(){
8080

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

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

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

0 commit comments

Comments
 (0)