Skip to content

Commit

Permalink
Merge 90e2a89 into 5d910e5
Browse files Browse the repository at this point in the history
  • Loading branch information
wupengFEX authored Nov 1, 2017
2 parents 5d910e5 + 90e2a89 commit 2032b4f
Show file tree
Hide file tree
Showing 9 changed files with 160 additions and 66 deletions.
2 changes: 1 addition & 1 deletion cases/212.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[]
[]
36 changes: 36 additions & 0 deletions cases/213.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<!DOCTYPE html>
<html mip="" lang="zh-CN">

<head>
<meta charset="utf-8">
<title></title>
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
<link rel="canonical" href="https://www.baidu.com">
<link rel="stylesheet" href="https://mipcache.bdstatic.com/static/v1/mip.css">
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<script src="https://mipcache.bdstatic.com/static/v1/mip.js"></script>
<script async src="https://mipcache.bdstatic.com/static/v1/mip-ad/mip-ad.js"></script>
</head>

<body>
<mip-form method="get" url="https://www.mipengine.org?we=123">
<input type="text" name="username" validatetarget="username" validatetype="must" placeholder="姓名">
<div target="username">姓名不能为空</div>
<input type="number" name="age" validatetarget="age" validatetype="must" placeholder="年龄">
<div target="age">年龄不能为空</div>
<input type="submit" value="提交">
</mip-form>
<mip-vd-baidu src="https://www.mipengine.org/static/img/banner2_wise_ab3d9a7.png" title="title" poster="https://www.mipengine.org/static/img/banner2_wise_ab3d9a7.png"></mip-vd-baidu>
<script src="https://mipcache.bdstatic.com/static/v1/mip-form/mip-form.js"></script>
<script type="text/javascript" src="https://mipcache.bdstatic.com/static/v1/mip-ad/mip-ad.js"></script>
<script type="application/json" src="https://mipcache.bdstatic.com/static/v1/mip-sidebar/mip-sidebar.js"></script>
<script type="" src="https://mipcache.bdstatic.com/static/v1/mip-showmore/mip-showmore.js"></script>
<script type="application/json">
{
a:1
}
</script>
<script async src="https://mipcache.bdstatic.com/static/v1/mip-vd-baidu/mip-vd-baidu.js"></script>
</body>

</html>
26 changes: 26 additions & 0 deletions cases/213.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[
{
"message": "标签'script'的强制性属性'async'缺失",
"code": "06200501",
"line": 11,
"col": 5,
"offset": 387,
"input": " <script src=\"https://mipcache.bdstatic.com/static/v1/mip.js\"></script>"
},
{
"message": "标签'script'中的属性'type'的属性值'application/json'无效",
"code": "06200301",
"line": 26,
"col": 5,
"offset": 1366,
"input": " <script type=\"application/json\" src=\"https://mipcache.bdstatic.com/static/v1/mip-sidebar/mip-sidebar.js\"></script>"
},
{
"message": "标签'script'中的属性'type'的属性值''无效",
"code": "06200301",
"line": 27,
"col": 5,
"offset": 1485,
"input": " <script type=\"\" src=\"https://mipcache.bdstatic.com/static/v1/mip-showmore/mip-showmore.js\"></script>"
}
]
2 changes: 2 additions & 0 deletions cases/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,5 @@
201|template中:标签'style'的直接父标签应该是'head',而不是'body'
202|标签'a'中的属性'href'的属性值'sms:'无效
203|标签'mip-video'中的既无属性'src'也无子节点 source
212|标签'mip-vd-baidu'必须包含'title'(非空), 'poster'(非空), 'src'(http[s]或//开头)属性
213|标签'script'在head中使用时应该家'async'属性
43 changes: 29 additions & 14 deletions dist/mip-validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -2941,7 +2941,7 @@ if (typeof Object.create === 'function') {
/*!
* Determine if an object is a Buffer
*
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/

Expand Down Expand Up @@ -16755,7 +16755,7 @@ function hasOwnProperty(obj, prop) {
},{"./support/isBuffer":56,"_process":36,"inherits":55}],58:[function(require,module,exports){
module.exports={
"name": "mip-validator",
"version": "1.5.9",
"version": "1.5.10",
"description": "MIP validator",
"main": "index.js",
"dependencies": {
Expand Down Expand Up @@ -16811,6 +16811,9 @@ module.exports={
"supertest": "^2.0.1",
"uglifyjs": "^2.4.10"
},
"engines": {
"node": ">=4.0.0"
},
"scripts": {
"test": "DEBUG='mip-validator:' mocha",
"lint": "eslint src/ test/ bin/ index.js",
Expand Down Expand Up @@ -16940,10 +16943,31 @@ module.exports={

}
},
"script": [{
"script": [
{
"mandatory": {
"type": "/^(text\/javascript)?/",
"src": "/^(https:)?\/\/(mipcache.bdstatic.com\/static\/mipmain)|(m.baidu.com\/static\/ala\/sf\/static\/)|((https:)?\/\/mipcache.bdstatic.com\/static\/v\\d\/)|((https:)?\/\/c.mipcdn.com\/static\/v\\d\/)|((https:)?\/\/c.mipcdn.com\/static\/mipmain)/"
"type": "/^(text\/javascript)?/",
"src": "/^(https:)?\/\/(mipcache.bdstatic.com\/static\/mipmain)|(m.baidu.com\/static\/ala\/sf\/static\/)|((https:)?\/\/mipcache.bdstatic.com\/static\/v\\d\/)|((https:)?\/\/c.mipcdn.com\/static\/v\\d\/)|((https:)?\/\/c.mipcdn.com\/static\/mipmain)/"
}
},
{
"match": {
"src": "/^(https:)?\/\/(mipcache.bdstatic.com\/static\/mipmain)|(m.baidu.com\/static\/ala\/sf\/static\/)|((https:)?\/\/mipcache.bdstatic.com\/static\/v\\d\/)|((https:)?\/\/c.mipcdn.com\/static\/v\\d\/)|((https:)?\/\/c.mipcdn.com\/static\/mipmain)/"
},
"attrs": {
"type": {
"value": "/^(text\/javascript)$/"
}
}
}, {
"match_ancestor": "head",
"match": {
"src": "/^(https:)?\/\/(mipcache.bdstatic.com\/static\/mipmain)|(m.baidu.com\/static\/ala\/sf\/static\/)|((https:)?\/\/mipcache.bdstatic.com\/static\/v\\d\/)|((https:)?\/\/c.mipcdn.com\/static\/v\\d\/)|((https:)?\/\/c.mipcdn.com\/static\/mipmain)/"
},
"attrs": {
"async": {
"mandatory": true
}
}
}, {
"disallow": true,
Expand All @@ -16953,15 +16977,6 @@ module.exports={
}
}, {
"disallowed_ancestor": "template"
},{
"attrs": {
"async": [{
"match": {
"match_ancestor": "head"
},
"mandatory": true
}]
}
}],
"mip-input": {
"mandatory_ancestor": "mip-form",
Expand Down
4 changes: 2 additions & 2 deletions dist/mip-validator.min.js

Large diffs are not rendered by default.

72 changes: 36 additions & 36 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mip-validator",
"version": "1.5.9",
"version": "1.5.10",
"description": "MIP validator",
"main": "index.js",
"dependencies": {
Expand Down Expand Up @@ -56,6 +56,9 @@
"supertest": "^2.0.1",
"uglifyjs": "^2.4.10"
},
"engines": {
"node": ">=4.0.0"
},
"scripts": {
"test": "DEBUG='mip-validator:' mocha",
"lint": "eslint src/ test/ bin/ index.js",
Expand Down
Loading

0 comments on commit 2032b4f

Please sign in to comment.