如何解决“错误:找不到HTMLHint,...,CodeMirror HTML衬里无法运行。” CodeMirror错误

问题描述 投票:1回答:1

我想让我的CodeMirror实例使用HTML棉绒。我能够使CSS和JS linting正常工作,但HTML linting无法正常工作。我仍在HTML的控制台日志中收到“ Error: HTMLHint not found, not defined on window, or not available through define/require, CodeMirror HTML linting cannot run.”错误。我在哪里包括全局“ HTMLHint”变量?

我已经下载了所需的HTML linting文件(//取决于http://htmlhint.com/js/htmlhint.js中的htmlhint.js],并将其链接到“ <head>”中。

<head>
       <script src="plugin/HTMLHint-develop/dist/htmlhint.js"></script>
</head>

<script>
        var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
            theme: "rubyblue",
            mode: "htmlmixed",
            scrollbarStyle: "simple",
            indentUnit: 4,
            lineNumbers: true,
            lineWrapping: true,
            foldGutter: true,
            lint: true
        });
</script>

我希望棉绒将基于“ <script></script>”标签起作用。显然我必须缺少一些东西。

我想让我的CodeMirror实例使用HTML棉绒。我能够使CSS和JS linting正常工作,但HTML linting无法正常工作。我仍然收到“错误:找不到HTMLHint,不是...

javascript codemirror
1个回答
0
投票

在HTML提示js文件中,它说:

© www.soinside.com 2019 - 2024. All rights reserved.