瀏覽代碼

Fixed image align in markdown content

NGPixel 8 年之前
父節點
當前提交
993bf83a44
共有 2 個文件被更改,包括 7 次插入0 次删除
  1. 0 0
      assets/css/app.css
  2. 7 0
      libs/markdown.js

文件差異過大導致無法顯示
+ 0 - 0
assets/css/app.css


+ 7 - 0
libs/markdown.js

@@ -244,6 +244,13 @@ const parseContent = (content) => {
     })
   })
 
+  // Apply align-center to parent
+
+  cr('img.align-center').each((i, elm) => {
+    cr(elm).parent().addClass('align-center')
+    cr(elm).removeClass('align-center')
+  })
+
   output = cr.html()
 
   return output

部分文件因文件數量過多而無法顯示