Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/ChinaGodMan/UserScripts
/ formatTrans
Function
formatTrans
smart-translator-tool/smart-translator-tool.user.js:1422–1424 ·
view source on GitHub ↗
(texts = '')
Source
from the content-addressed store, hash-verified
1420
1421
// 格式化页面划选的文本,拆分成数组
1422
const
formatTrans = (texts =
''
) => {
1423
return
(texts.split(/[\n\t]+/) || []).filter(text => text)
1424
}
1425
1426
// copy 文本
1427
const
copyText = (text) => {
Callers
1
startTrans
Function · 0.85
Calls
no outgoing calls
Tested by
no test coverage detected