소스 검색

filter tag 'a' deal when HTML to Markdown.
modify tip text.

zhuzhuyule 7 년 전
부모
커밋
e05dced43c
3개의 변경된 파일10개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 1
      app/moe-pdf.js
  2. 8 0
      views/main/CodeMirror/editor.js
  3. 1 1
      views/main/moe-popmessage.js

+ 1 - 1
app/moe-pdf.js

@@ -44,7 +44,7 @@ function exportPDF(content, cb) {
         return s;
     }
 
-    tmp = path.join(os.tmpdir(), 'Moeditor-export-' + randString(10) + '.html');
+    tmp = path.join(os.tmpdir(), 'HexoEditor-export-' + randString(10) + '.html');
     MoeditorFile.write(tmp, content.s);
     fileName = content.path;
     errorHandler = cb;

+ 8 - 0
views/main/CodeMirror/editor.js

@@ -394,6 +394,14 @@ module.exports = (() => {
                             }
                             return "![](" + node.src + ")";
                         }
+                    },{
+                        filter: 'a',
+                        replacement: function (innerHTML, node) {
+                            if (innerHTML.length > 0) {
+                                return "["+innerHTML+"](" + node.href + ")";
+                            }
+                            return "";
+                        }
                     }
                 ], gfm: true
             });

+ 1 - 1
views/main/moe-popmessage.js

@@ -71,7 +71,7 @@ document.addEventListener('DOMContentLoaded', () => {
         let hexoWindow  = window.hexoWindow;
 
         if (hexoWindow.fileName !== '') {
-            document.getElementsByTagName('title')[0].innerText = 'Moeditor - ' + path.basename(hexoWindow.fileName);
+            document.getElementsByTagName('title')[0].innerText = 'HexoEditor - ' + path.basename(hexoWindow.fileName);
         }
 
         // TODO-ly 解决第一次图片保存地址不对的问题