@@ -42,7 +42,7 @@ var parser = function(string, callback, argvObj, queryObj, commonData) {
42
42
callback = emptyFn ;
43
43
}
44
44
var splitReg = / \[ s l i d e \s * ( .* ) \] / ig;
45
- var slidesSetting = string . match ( splitReg ) ;
45
+ var slidesSetting = string . match ( splitReg ) || [ ] ;
46
46
var contents = string . split ( / \[ s l i d e .* \] / i) ;
47
47
// console.log(contents.length, slidesSetting);
48
48
//第一个是封面
@@ -211,7 +211,13 @@ function parse(str, note, sAttrs) {
211
211
}
212
212
return tagStart + note + '<section class="slide-wrapper">' + content + '</section></slide>' ;
213
213
}
214
-
214
+ /**
215
+ * 替换属性
216
+ * @param {[type] } str [description]
217
+ * @param {Boolean } isArticle [description]
218
+ * @param {[type] } noHead [description]
219
+ * @return {[type] } [description]
220
+ */
215
221
function doAttr ( str , isArticle , noHead ) {
216
222
//input:## Title {:.build width="200px"}
217
223
//output: <h2 class="build" width="200px">Title</h2>
@@ -228,7 +234,12 @@ function doAttr(str, isArticle, noHead) {
228
234
229
235
return str ;
230
236
}
231
-
237
+ /**
238
+ * 合并attr
239
+ * @param {string } oldAttr 老属性
240
+ * @param {string } newAttr 新属性
241
+ * @return {[type] } [description]
242
+ */
232
243
function mergeAttr ( oldAttr , newAttr ) {
233
244
if ( ! oldAttr ) {
234
245
return newAttr ;
@@ -273,7 +284,12 @@ function mergeAttr(oldAttr, newAttr) {
273
284
} ) ;
274
285
return back . join ( ' ' ) ;
275
286
}
276
-
287
+ /**
288
+ * 解析自定义属性
289
+ * @param {[type] } idinput [description]
290
+ * @param {[type] } attrs [description]
291
+ * @return {[type] } [description]
292
+ */
277
293
function parseAttr ( idinput , attrs ) {
278
294
attrs = attrs . split ( / \s + / ) ;
279
295
// console.log(attrs);
0 commit comments