Skip to content

Commit

Permalink
fix:Zettlr#2213 - render links and show tooltips on links
Browse files Browse the repository at this point in the history
  • Loading branch information
krmanik committed Jun 29, 2022
1 parent 6a91cce commit dc79f71
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions source/common/modules/markdown-editor/plugins/render-tables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,16 @@ function writeTableToDocument (cm: CodeMirror.Editor, table: TableEditor): boole
* @param {CodeMirror.Editor} cm The editor instance
*/
;(commands as any).markdownRenderTables = function (cm: CodeMirror.Editor) {
let aTags = cm.getWrapperElement().getElementsByTagName("A");
for (let a of aTags) {
if (!a.classList.contains('cma')) {
let url = a.getAttribute("href");
a.removeAttribute("href");
a.setAttribute("title", url!);
a.classList.add("cma");
}
}

// Now render all potential new tables. We only check one line less
// because such a table header WILL NEVER be on the last line, plus
// this way we can check for Setext headers without having to worry.
Expand Down

0 comments on commit dc79f71

Please sign in to comment.