Skip to content

fix(md): 修复 md 标签中的错误引用和英文语法问题#968

Merged
lovelyJason merged 1 commit into7.xfrom
fix/md-tag-error-handling
Apr 2, 2026
Merged

fix(md): 修复 md 标签中的错误引用和英文语法问题#968
lovelyJason merged 1 commit into7.xfrom
fix/md-tag-error-handling

Conversation

@lovelyJason
Copy link
Copy Markdown
Collaborator

Summary

  • 修复 md 标签在 fetch 请求失败时引用未定义变量 json 导致的 ReferenceError,改为使用当前作用域内的 statusdata 输出有意义的错误信息
  • 修正英文提示文案 "Your browser outdated""Your browser is outdated"

Details

当使用 {% md URL %} 标签加载远程 Markdown 文件时,如果 HTTP 请求返回非 200 状态码,原代码执行 throw new Error(JSON.stringify(json.error)),但当前作用域中并不存在 json 变量(只有 okstatusdataheaders),导致抛出 ReferenceError: json is not defined,掩盖了真实的请求失败原因。

修复后会输出 Request failed with status {status}: {data},便于定位问题。

Made with Cursor

- 修复 fetch 失败时引用未定义变量 json 导致的 ReferenceError
- 修正提示文案 "Your browser outdated" 为 "Your browser is outdated"
@github-actions github-actions bot added Dependencies Pull requests that update a dependency file Configurations Pull requests that update a configuration file Actions Pull requests that update an action file CSS Pull requests that update a style file Layout Pull requests that update a layout file Scripts Pull requests that update a scripts file i18n Pull requests that update a language file JS Pull requests that update Javascript code labels Apr 2, 2026
@lovelyJason lovelyJason merged commit e2cb6ad into 7.x Apr 2, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Actions Pull requests that update an action file Configurations Pull requests that update a configuration file CSS Pull requests that update a style file Dependencies Pull requests that update a dependency file i18n Pull requests that update a language file JS Pull requests that update Javascript code Layout Pull requests that update a layout file Scripts Pull requests that update a scripts file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant