This repository was archived by the owner on Oct 17, 2025. It is now read-only.
Commit 4e13100
Issue#946 open links in new tab (#1009)
I added two helper functions that are called inside the editor's `render` method.
`openLinksInNewTab` prevents the default click event on external links (all anchors with an `href` attribute that starts with `http`) and opens them in a new tab.
While I was at it, I stumbled upon the issue that relative links (like `<a href="#someanchor">`) also didn't work. I didn't find a ticket for that so I thought it would make sense to fix in the scope of this ticket.
`scrollToAnchors` prevents the default click event on relative links and scrolls the targeted anchor into view.
I hope that the code structure adheres to your quality standards.1 parent c977bc4 commit 4e13100
2 files changed
Lines changed: 29 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
40 | 53 | | |
41 | 54 | | |
42 | 55 | | |
| |||
45 | 58 | | |
46 | 59 | | |
47 | 60 | | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
48 | 75 | | |
49 | 76 | | |
50 | 77 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| 83 | + | |
| 84 | + | |
83 | 85 | | |
84 | 86 | | |
85 | 87 | | |
| |||
0 commit comments