Commit 7b1b15f
committed
feat: improve wiki link rendering
## Details
Discussion: #284
Wiki links are rendered using a single extmark which conceals all
content and then adds inline text as an overlay. This works but means
that any other styles such as a strike through are removed.
To improve this handle each component of the wiki link separately,
similarly to the way autolinks are handled. This means we:
- Hide the opening bracket
- Inline the icon
- Hide the link destination if an alias exists
- Hide the closing bracket
As 4 separate individual marks. This means the contents of the alias &
destination will keep the style they had before rendering.1 parent 1636954 commit 7b1b15f
File tree
4 files changed
+45
-24
lines changed- doc
- lua/render-markdown
- render
- tests
4 files changed
+45
-24
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | | - | |
102 | | - | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
103 | 110 | | |
104 | | - | |
| 111 | + | |
105 | 112 | | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
106 | 130 | | |
107 | | - | |
| 131 | + | |
108 | 132 | | |
109 | 133 | | |
110 | 134 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | 50 | | |
65 | 51 | | |
66 | 52 | | |
| |||
75 | 61 | | |
76 | 62 | | |
77 | 63 | | |
78 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
79 | 67 | | |
80 | 68 | | |
81 | 69 | | |
82 | 70 | | |
83 | | - | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
84 | 75 | | |
85 | 76 | | |
86 | 77 | | |
87 | 78 | | |
88 | | - | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
89 | 83 | | |
90 | 84 | | |
91 | 85 | | |
92 | 86 | | |
93 | | - | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
94 | 91 | | |
95 | 92 | | |
96 | 93 | | |
| |||
0 commit comments