Skip to content

Commit

Permalink
docs: fix document deploy (#609)
Browse files Browse the repository at this point in the history
Ref #608
  • Loading branch information
popomore authored and atian25 committed Mar 21, 2017
1 parent 8a64ceb commit 2296b7b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/source/zh-cn/core/security.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ console.log(`var foo = "${this.helper.sjs(foo)}";`);
```

还有一种情况,有时候我们需要在 JavaScript 中输出 json ,若未做转义,易被利用为 XSS 漏洞。框架提供了 `helper.sjson()` 宏做 json encode,会遍历 json 中的 key ,将 value 的值中,所有非白名单字符转义为 `\x` 形式,防止 XSS 攻击。同时保持 json 结构不变。
若存在模板中输出一个 JSON 字符串给 JavaScript 使用的场景,请使用 `{{ helper.sjson(变量名) }}` 进行转义。
若存在模板中输出一个 JSON 字符串给 JavaScript 使用的场景,请使用 `helper.sjson(变量名)` 进行转义。

**处理过程较复杂,性能损耗较大,请仅在必要时使用。**

Expand Down
2 changes: 1 addition & 1 deletion scripts/doc.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ co(function* () {
yield jsdoc('docs/public/api');
break;
case 'build':
// yield runscript('hexo --cwd docs generate --force');
yield runscript('hexo --cwd docs generate --force');
yield jsdoc('docs/public/api');
break;
case 'deploy':
Expand Down

0 comments on commit 2296b7b

Please sign in to comment.