浏览代码

chore: hide demo description when it's empty (#15014)

hetech 6 年之前
父节点
当前提交
330800016d
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      build/md-loader/containers.js

+ 1 - 1
build/md-loader/containers.js

@@ -11,7 +11,7 @@ module.exports = md => {
         const description = m && m.length > 1 ? m[1] : '';
         const content = tokens[idx + 1].type === 'fence' ? tokens[idx + 1].content : '';
         return `<demo-block>
-        <div>${md.render(description)}</div>
+        ${description ? `<div>${md.render(description)}</div>` : ''}
         <!--element-demo: ${content}:element-demo-->
         `;
       }