File tree Expand file tree Collapse file tree 2 files changed +20
-4
lines changed Expand file tree Collapse file tree 2 files changed +20
-4
lines changed Original file line number Diff line number Diff line change @@ -242,14 +242,24 @@ Links to the RFC page (external).
242
242
#### Settings
243
243
244
244
*** Syntax: ` [[setting,setting_name(,args)]] ` ***
245
+ *** Syntax: ` [[setting_text,setting_name(,text)]] ` ***
245
246
246
- If args is set, it is appended to the display as a setting value. Example:
247
+ For the ` setting ` variant, if args is set, it is appended to the display as a
248
+ setting value. Example:
247
249
248
250
```
249
251
# [[setting,foo,5]] results in:
250
252
<a href="PATH_TO_FOO_SETTING">foo = 5</a>
251
253
```
252
254
255
+ For the ` setting_text ` variant, if text is set, it is used as the link text.
256
+ Example:
257
+
258
+ ```
259
+ # [[setting_text,foo,bar]] results in:
260
+ <a href="PATH_TO_FOO_SETTING">bar</a>
261
+ ```
262
+
253
263
#### Variable
254
264
255
265
*** Syntax: ` [[variable(,section)]] ` ***
Original file line number Diff line number Diff line change @@ -156,6 +156,7 @@ function dovecot_markdown(md, opts) {
156
156
case 'doveadm' :
157
157
case 'event' :
158
158
case 'setting' :
159
+ case 'setting_text' :
159
160
env . inner = parts [ 1 ]
160
161
env . args = parts [ 2 ] ? parts [ 2 ] : undefined ;
161
162
@@ -179,16 +180,17 @@ function dovecot_markdown(md, opts) {
179
180
break
180
181
181
182
case 'setting' :
183
+ case 'setting_text' :
182
184
/* Settings names can have brackets, so we need to unescape
183
185
* input for purposes of searching settings keys. */
184
- const search_str = env . inner . replaceAll ( '>' , '< ' )
185
- . replaceAll ( '<' , '> ' )
186
+ const search_str = env . inner . replaceAll ( '>' , '> ' )
187
+ . replaceAll ( '<' , '< ' )
186
188
187
189
if ( ! opts . settings [ search_str ] ) {
188
190
handle_error ( 'setting link missing: ' + env . inner )
189
191
return '<code><a>'
190
192
}
191
- page + = 's '
193
+ page = 'settings '
192
194
break
193
195
}
194
196
@@ -334,6 +336,9 @@ function dovecot_markdown(md, opts) {
334
336
case 'setting' :
335
337
return env . inner + ( env . args ? ' = ' + env . args : '' )
336
338
339
+ case 'setting_text' :
340
+ return env . args ?? env . inner
341
+
337
342
case 'variable' :
338
343
return env . inner
339
344
@@ -357,6 +362,7 @@ function dovecot_markdown(md, opts) {
357
362
case 'event' :
358
363
case 'man' :
359
364
case 'setting' :
365
+ case 'setting_text' :
360
366
case 'variable' :
361
367
return '</a></code>'
362
368
You can’t perform that action at this time.
0 commit comments