-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
fix(handles): fix that when downloading, markdown file will be parsed into html. #8540
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
base: main
Are you sure you want to change the base?
Conversation
WalkthroughThis pull request addresses an issue where markdown files were automatically parsed into HTML in proxy mode, affecting their preview and download. The fix involves removing the code that prioritized markdown file processing, ensuring that markdown files are no longer converted to HTML. Changes
|
感觉这个功能的名称有问题,应该改为 过滤 Markdown 文件中的脚本 比较好,不然这个 PR 合并后点击其他带毒 Markdown 文件一样会 XSS。 如果没过滤需求建议直接在设置中关掉。 |
use EqualFold instead of regex
确实是的 |
是否能通过单独判断下载请求和预览请求来解决误伤下载文件的问题,主要是因为在出口处全部渲染会导致所有获得md文件的途径都无法回去原始文件 |
预览走 |
delete binary file
修复了在代理模式下(比如本地),markdown文档在下载的情况下依然会被自动parse成html的问题,这会导致下载的markdown文件都是parse过的,如截图所示。
Fixed the problem that in proxy mode (such as local),markdown documents will still be automatically parsed into html when downloaded, which will cause the downloaded markdown files to be parsed, as shown in the screenshot.
如果是其他类型的文件(如txt)就没有这个问题。
If it is other types of files (such as txt), there is no problem.