Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/apache-spark/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Gruntjs 咕噜声与“引语”_Gruntjs - Fatal编程技术网

Gruntjs 咕噜声与“引语”

Gruntjs 咕噜声与“引语”,gruntjs,Gruntjs,我刚开始咕哝,但我花了很长时间在一个简单的问题上。单个引号正在转换为html实体。如何避免这种转换 原始HTML: <button type="submit" onclick="document.forms['search'].submit(); return false;">Search </button> 跑步后呼噜声: <button type="submit" onclick="document.forms[&am

我刚开始咕哝,但我花了很长时间在一个简单的问题上。单个引号正在转换为html实体。如何避免这种转换

原始HTML:

<button type="submit" onclick="document.forms['search'].submit(); return false;">Search                      </button>
跑步后呼噜声:

<button type="submit" onclick="document.forms[&apos;search**&apos;].submit(); return false;">Search</button>

谢谢

正如我之前所说,我是GruntJS新手,所以我不确定这是否是最好的解决方案,我将感谢您的进一步评论

但是,这对我很有用: 我安装了grunt string replace,并在Gruntfile.js中添加了以下代码

'string-replace': {
        dist: {
            files: {
                'dist/': '**/*.html'                   
            },


            options: {
                replacements: [{
                    pattern: /(&apos;)/ig,
                    replacement: '\''
                  }
                ]
            }
        }
    }
以及:

loadNpmTasks'grunt-string-replace'

运行['X','Y','Z','string-replace']