Skip to content

Commit

Permalink
feat(names): remove parenthesed portion of names
Browse files Browse the repository at this point in the history
  • Loading branch information
missinglink committed Aug 11, 2021
1 parent d952ea4 commit 16d92d1
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 78 deletions.
4 changes: 3 additions & 1 deletion stream/tag_mapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ module.exports = function(){

// use one of the preferred name tags listed above
if ( defaultName ){
doc.setName('default', defaultName);
doc.setName('default', trim( defaultName ) );
}

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

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

Expand Down
Loading

0 comments on commit 16d92d1

Please sign in to comment.