Troubleshooting KumaScript errors - The MDN project 编辑

KumaScript errors appearing on a page can be very off-putting to readers, in their big scary red boxes, but fortunately anyone with an MDN account can edit a document to fix such an error. When a page has an error it gets added to the list of documents with errors.  Site editors go through this list regularly to find and fix errors. This article details the four types of KumaScript error, and some steps you can take to fix them.

DocumentParsingError

DocumentParsingError errors appear when KumaScript has trouble understanding something in the document itself. The most common cause is a syntax error in a macro.

Check for:

Use of curly braces without intending to call a macro.
If you need to write  { in a document without calling a macro you can escape it with a \ like this: \{
Use of a special character in a macro parameter.
If you need to use a " or a \  inside of a macro parameter they can be escaped with a \ like this: \\ or \"
Missing commas between macro parameters.
Macro parameters need to be delimited by a comma (,) but not at the end of the list of parameters; for example {{anch("top", "Back to top")}}.
HTML tags appearing inside a macro call
If you apply styling to a macro, it will often break because, for example, a </code> tag may have appeared inside the macro code in the source code. Check the source view to see what's there, and remove any unnecessary styling.

    TemplateLoadingError

    TemplateLoadingError errors appear when KumaScript has trouble finding which macro to include on a page.

    Check for:

    Misspelling of macro names or renamed macros.
    You can look at the list of known macros in the Github repo.

    Tip: You can make it quick and easy to jump to a specific macro by adding a search keyword to Firefox. See Using search keywords to open template pages in KumaScript for a step-by-step guide to creating the search keyword for this.

    TemplateExecutionError

    TemplateExecutionError errors appear when KumaScript encounters an error in the macro. These errors can only be fixed by admin users and need to be reported as bugs.

    Before reporting an error check to see that it hasn't already been fixed. You can do this by forcing KumaScript to give you a fresh copy of the page by holding down Shift while you refresh the page (Shift + Ctrl + R on Windows/Linux, Shift + Cmd + R on Mac).

    If the error persists, report a bug, including the URL of the page and the text of the error.

    Error & Unknown

    This is the category errors end up in if they are not one of the other kinds of error.

    Check for fixes and report persistent bugs like described under TemplateExecutionError.

    如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

    扫码二维码加入Web技术交流群

    发布评论

    需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
    列表为空,暂无数据

    词条统计

    浏览:60 次

    字数:4083

    最后编辑:8年前

    编辑次数:0 次

      我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
      原文