Skip to content
This repository was archived by the owner on Aug 15, 2018. It is now read-only.

Commit 846f6e0

Browse files
committed
feat(doc) can write jsx in md, Close #1113
1 parent e8cefd4 commit 846f6e0

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

lib/theme/theme.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ module.exports = function(nico) {
44

55
var exports = {};
66

7+
var ReactTools = require('react-tools');
78
var path = require('path');
89
var util = require('util');
910
var file = nico.sdk.file;
@@ -73,6 +74,8 @@ module.exports = function(nico) {
7374
return replacement;
7475
}
7576
var code = match[2];
77+
// 转换 jsx 代码
78+
code = ReactTools.transform(code);
7679
// 使用 seajs.use 调用的代码不包裹
7780
// 其他则视作 CommonJS 代码,包括为 CMD 格式并用 seajs.use 进行启动
7881
if (code.indexOf('seajs.use') < 0) {

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
"jscoverage": "~0.5.9",
4444
"mocha-browser2": "~0.3.1",
4545
"nico": "~0.5.1",
46+
"react-tools": "~0.12.2",
4647
"request": "~2.51.0",
4748
"rimraf": "~2.2.8",
4849
"semver": "~4.1.0",

0 commit comments

Comments
 (0)