浏览代码

feat: 优化loader

zhenyulei 5 年之前
父节点
当前提交
daa4d8b874
共有 2 个文件被更改,包括 5 次插入5 次删除
  1. 4 4
      loader/md-vue/index.js
  2. 1 1
      src/packages/button/doc.md

+ 4 - 4
loader/md-vue/index.js

@@ -31,10 +31,10 @@ module.exports = function(source) {
 
     // 重新计算下一次的位置
     // demoComponentName 与id,命名每个demo组件名字用的,id会在while每一次循环+1,这样子组件从第一个到最后一个都不会重名。
-    // id++;
-    // start = commentEnd + endTagLen;
-    // commentStart = content.indexOf(startTag, start);
-    // commentEnd = content.indexOf(endTag, commentStart + startTagLen);
+    id++;
+    start = commentEnd + endTagLen;
+    commentStart = content.indexOf(startTag, start);
+    commentEnd = content.indexOf(endTag, commentStart + startTagLen);
   }
 
   // 仅允许在 demo 不存在时,才可以在 Markdown 中写 script 标签

+ 1 - 1
src/packages/button/doc.md

@@ -14,7 +14,7 @@
 ### 基础用法
 
 :::demo
-```html
+``` html
 <template>
   <div @click="clickMe">点击我</div>
 </template>