Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG:正则中的日期不会翻译 #261

Open
TC999 opened this issue Aug 7, 2024 · 13 comments
Open

BUG:正则中的日期不会翻译 #261

TC999 opened this issue Aug 7, 2024 · 13 comments
Labels
bug Something isn't working

Comments

@TC999
Copy link
Contributor

TC999 commented Aug 7, 2024

测试链接:https://github.com/maboloshi/hexo-action

如图所示

image

但在 Chrome 中是正常的

image

词条如下:(在locals.js5999行)

[/This repository has been archived by the owner (on .+). It is now read-only./, "此仓库已由所有者于 $1 存档。它现在是只读的。"],
Repository owner deleted a comment Aug 18, 2024
@maboloshi
Copy link
Owner

我本地的开发版有问题😒, 1.9.3 chrome 还是正常的, firefox @TC999 你这边能再测试一下么

@TC999
Copy link
Contributor Author

TC999 commented Aug 19, 2024

Firefox 无法访问文件网址,无法测试

@TC999
Copy link
Contributor Author

TC999 commented Aug 20, 2024

现在 Chrome 也出现了这个BUG

@TC999 TC999 changed the title Firefox 独有BUG:正则中的日期不会翻译 BUG:正则中的日期不会翻译 Aug 20, 2024
@TC999
Copy link
Contributor Author

TC999 commented Jan 5, 2025

终于把这个BUG解决了,这是解决方案 #332

@buiawpkgew1
Copy link
Contributor

Image翻译丢失

@TC999
Copy link
Contributor Author

TC999 commented Feb 15, 2025

Image翻译丢失

更新一下

@buiawpkgew1
Copy link
Contributor

Image翻译丢失

更新一下

更新完了但是

Image

@maboloshi
Copy link
Owner

估计又被我改废了🤣

@maboloshi
Copy link
Owner

maboloshi commented Feb 15, 2025

Image翻译丢失

更新一下

更新完了但是

Image

原因找到 默认全局正则优先于 页面规则, 且没有二次正则机制

后续考虑对特定正则规则引入二次正则的可选项

本地测试通过, 后续优化代码

@TC999
Copy link
Contributor Author

TC999 commented Feb 15, 2025

我之前的解决方案是把日期部分调用时间正则翻译后返回

@maboloshi
Copy link
Owner

maboloshi commented Feb 15, 2025

已解决 6bc5f7b
@TC999 我修改了几条示例正则 其他的有劳改一下(您新增的几条规则的 原始字符串含义我不太清楚), 注意识别符0和1 目前代表绝对时间和相关时间规则

貌似还不是真好的方式

@maboloshi maboloshi reopened this Feb 15, 2025
@maboloshi
Copy link
Owner

maboloshi commented Feb 15, 2025

注释if (shouldSkip(text)) return false;和修改regexpRules内部的顺序 也能开启二次正则

目前 不清楚是否有更好的方式

@maboloshi
Copy link
Owner

目前 先用 @TC999 的方案紧急 fix 11c65f5

我之前的解决方案是把日期部分调用时间正则翻译后返回

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants
@maboloshi @buiawpkgew1 @TC999 and others