Update index.js

This commit is contained in:
Harvey Zack committed 2025-05-23 00:32:08 +08:00
1 parent 5d7710979d
commit 9fdbdabd7c
1 file changed
+8 -5
+8 -5
View File
@@ -22,11 +22,14 @@ export default function artplayerPluginAsr(option = {}) {
}); });
function splitByPunctuation(text) { function splitByPunctuation(text) {
return text return (
.split(/(?<=[、。!?!?\.])\s*/u) text
.map((s) => s.trim()) // eslint-disable-next-line no-useless-escape
.filter(Boolean) .split(/(?<=[、。!?!?\.])\s*/u)
.slice(-length); .map((s) => s.trim())
.filter(Boolean)
.slice(-length)
);
} }
function hide() { function hide() {