Skip to content

Commit

Permalink
retain hyphens in names
Browse files Browse the repository at this point in the history
  • Loading branch information
nleanba committed Apr 2, 2024
1 parent 6852c1e commit a7ed7c4
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/gg2rdf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1259,8 +1259,7 @@ export function gg2rdf(

function removePunctuation(s: string) {
if (!s) return "";
// if preserving `-` is desired, replace the regex with /(?:\p{Z}|\p{S}|\p{P})(?<![-])/ug
const result = s.replace(/\p{Z}|\p{S}|\p{P}/ug, "");
const result = s.replace(/(?:\p{Z}|\p{S}|\p{P})(?<![-])/ug, "");
if (result !== s) {
console.log(`Warning: Normalizing "${s}" to "${result}".`);
}
Expand Down

0 comments on commit a7ed7c4

Please sign in to comment.