Skip to content

Commit

Permalink
Update add mark helper
Browse files Browse the repository at this point in the history
  • Loading branch information
memochou1993 committed Mar 5, 2023
1 parent c241460 commit 6169c2b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion utils/add-mark.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import config from '../config/index.js';

const addMark = (text) => {
const marks = ['?', '。', '!', '?', '.', '!'];
if (marks.some((mark) => text.endsWith(mark))) {
return text;
}
return `${text}.`;
if (config.APP_LANG === 'zh' || config.APP_LANG === 'ja') return '。';
return '.';
};

export default addMark;

0 comments on commit 6169c2b

Please sign in to comment.