Commit 7620d4e
committed
feat: allow users to disable code block delimiter concealing
## Details
Request: #475
Among the changes introduced back in `0.11.0`, how the delimiter nodes
around code blocks were handled was one them. Rather than a horizontal
conceal a new vertical conceal was added which entirely removed those
lines if conceal was enabled.
In order to still allow borders to be rendered I needed a way to disable
this feature while still allowing for concealing elsewhere. Luckily in
the set of changes a way to dynamically turn off certain highlights was
also added, which we use at startup to disable this behavior for users.
While fixing all the odds and ends I decided to replicate the old
behavior and apply a horizontal conceal over the various delimiter
nodes, I didn't give much thought towards other approaches.
This feature allows users who want those delimiter elements to still
have them. To make this happen the following new options have been added:
- `code.conceal_delimiters` - stops us from adding conceal over the
delimiter nodes if set to `false`
- `code.language` - a more direct way to disable language headings,
functionally the same as `style = 'normal'`
To get the backticks back these 2 must be set properly and `border` must
also be disabled. This removes all the things that currently cover these
nodes, final config ends up as:
```lua
require('render-markdown').setup({
code = {
conceal_delimiters = false,
language = false,
border = 'none',
},
})
```1 parent 12d951d commit 7620d4e
File tree
6 files changed
+77
-46
lines changed- doc
- lua/render-markdown
- config
- render/markdown
6 files changed
+77
-46
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
435 | 435 | | |
436 | 436 | | |
437 | 437 | | |
438 | | - | |
439 | | - | |
440 | | - | |
441 | | - | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
442 | 442 | | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
443 | 447 | | |
444 | 448 | | |
445 | 449 | | |
446 | 450 | | |
447 | | - | |
448 | | - | |
449 | | - | |
450 | 451 | | |
451 | 452 | | |
452 | 453 | | |
453 | 454 | | |
454 | 455 | | |
455 | 456 | | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
456 | 460 | | |
457 | 461 | | |
458 | 462 | | |
| |||
1058 | 1062 | | |
1059 | 1063 | | |
1060 | 1064 | | |
1061 | | - | |
1062 | | - | |
1063 | | - | |
1064 | | - | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
1065 | 1069 | | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
1066 | 1074 | | |
1067 | 1075 | | |
1068 | 1076 | | |
1069 | 1077 | | |
1070 | | - | |
1071 | | - | |
1072 | | - | |
1073 | 1078 | | |
1074 | 1079 | | |
1075 | 1080 | | |
1076 | 1081 | | |
1077 | 1082 | | |
1078 | 1083 | | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
1079 | 1087 | | |
1080 | 1088 | | |
1081 | 1089 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
501 | 501 | | |
502 | 502 | | |
503 | 503 | | |
504 | | - | |
505 | | - | |
506 | | - | |
507 | | - | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
508 | 508 | | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
509 | 513 | | |
510 | 514 | | |
511 | 515 | | |
512 | 516 | | |
513 | | - | |
514 | | - | |
515 | | - | |
516 | 517 | | |
517 | 518 | | |
518 | 519 | | |
519 | 520 | | |
520 | 521 | | |
521 | 522 | | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
522 | 526 | | |
523 | 527 | | |
524 | 528 | | |
| |||
1118 | 1122 | | |
1119 | 1123 | | |
1120 | 1124 | | |
1121 | | - | |
1122 | | - | |
1123 | | - | |
1124 | | - | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
1125 | 1129 | | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
1126 | 1134 | | |
1127 | 1135 | | |
1128 | 1136 | | |
1129 | 1137 | | |
1130 | | - | |
1131 | | - | |
1132 | | - | |
1133 | 1138 | | |
1134 | 1139 | | |
1135 | 1140 | | |
1136 | 1141 | | |
1137 | 1142 | | |
1138 | 1143 | | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
1139 | 1147 | | |
1140 | 1148 | | |
1141 | 1149 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
4 | 6 | | |
5 | | - | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| 10 | + | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
| |||
68 | 70 | | |
69 | 71 | | |
70 | 72 | | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
75 | 77 | | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
76 | 82 | | |
77 | 83 | | |
78 | 84 | | |
79 | 85 | | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | 86 | | |
84 | 87 | | |
85 | 88 | | |
86 | 89 | | |
87 | 90 | | |
88 | 91 | | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
89 | 95 | | |
90 | 96 | | |
91 | 97 | | |
| |||
148 | 154 | | |
149 | 155 | | |
150 | 156 | | |
| 157 | + | |
| 158 | + | |
151 | 159 | | |
152 | | - | |
153 | 160 | | |
154 | 161 | | |
155 | 162 | | |
| 163 | + | |
156 | 164 | | |
157 | 165 | | |
158 | 166 | | |
| |||
| 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 | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | 75 | | |
79 | | - | |
80 | | - | |
81 | 76 | | |
| 77 | + | |
| 78 | + | |
82 | 79 | | |
83 | | - | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
84 | 86 | | |
85 | 87 | | |
86 | 88 | | |
| |||
104 | 106 | | |
105 | 107 | | |
106 | 108 | | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
107 | 112 | | |
108 | 113 | | |
109 | 114 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| 89 | + | |
| 90 | + | |
89 | 91 | | |
90 | | - | |
91 | 92 | | |
92 | 93 | | |
93 | 94 | | |
| 95 | + | |
94 | 96 | | |
95 | 97 | | |
96 | 98 | | |
| |||
0 commit comments