Skip to content

Commit

Permalink
fix(util/string): clean \r
Browse files Browse the repository at this point in the history
close #33
  • Loading branch information
bhsd-harry committed May 20, 2024
1 parent a8eccc5 commit 9e58840
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion util/string.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const factory = (
) => (str: string): string => str.replace(regex, replace as string);

/** 清理解析专用的不可见字符 */
export const tidy = factory(/[\0\x7F]/gu, '');
export const tidy = factory(/[\0\x7F]|\r$/gmu, '');

/** remove half-parsed comment-like tokens */
export const removeComment = factory(/\0\d+c\x7F/gu, '');
Expand Down

0 comments on commit 9e58840

Please sign in to comment.