You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix case-insensitive anchor ID collision in markdown help output (#10095)
Fixes#10083
The markdown help output (`slangc -help-style markdown -h`) generates
explicit `<a id>` anchor IDs for headings using case-sensitive
deduplication, but GitHub's markdown renderer generates heading IDs
case-insensitively. This causes the `## Target` category heading and `##
target` value section heading to produce non-colliding explicit anchors
(`Target` and `target`), while GitHub assigns them colliding auto-IDs
(`target` and `target-1`). The auto-ID `target-1` for `## target` then
coincides with the explicit anchor for the `### -target` option, so
clicking "target" in GitHub's right-side navigation scrolls to the
`-target` option instead of the target value list.
This fix lowercases anchor ID prefixes in `_getLinkName` so that
deduplication matches GitHub's case-insensitive behavior. The explicit
anchors now align with GitHub's auto-generated heading IDs, and the
right-side navigation links to the correct sections.
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@@ -108,7 +108,7 @@ Print this message, or help in specified category.
108
108
Help formatting style
109
109
110
110
111
-
<aid="I"></a>
111
+
<aid="i"></a>
112
112
### -I
113
113
114
114
**-I<path>, -I <path>**
@@ -174,7 +174,7 @@ Set the module name to use when compiling multiple .slang source files into a si
174
174
175
175
Specify a path where generated output should be written.
176
176
177
-
If no [-target](#target-1) or [-stage](#stage-1) is specified, one may be inferred from file extension (see [<file-extension>](#file-extension)). If multiple [-target](#target-1) options and a single [-entry](#entry) are present, each [-o](#o) associates with the first [-target](#target-1) to its left. Otherwise, if multiple [-entry](#entry) options are present, each [-o](#o) associates with the first [-entry](#entry) to its left, and with the [-target](#target-1) that matches the one inferred from <path>.
177
+
If no [-target](#target-2) or [-stage](#stage-1) is specified, one may be inferred from file extension (see [<file-extension>](#file-extension)). If multiple [-target](#target-2) options and a single [-entry](#entry) are present, each [-o](#o) associates with the first [-target](#target-2) to its left. Otherwise, if multiple [-entry](#entry) options are present, each [-o](#o) associates with the first [-entry](#entry) to its left, and with the [-target](#target-2) that matches the one inferred from <path>.
178
178
179
179
180
180
<aid="profile"></a>
@@ -196,7 +196,7 @@ Additional profiles that include [-stage](#stage-1) information:
196
196
197
197
See [-capability](#capability-1) for information on [<capability>](#capability)
198
198
199
-
When multiple [-target](#target-1) options are present, each [-profile](#profile) associates with the first [-target](#target-1) to its left.
199
+
When multiple [-target](#target-2) options are present, each [-profile](#profile) associates with the first [-target](#target-2) to its left.
200
200
201
201
202
202
<aid="stage-1"></a>
@@ -211,10 +211,10 @@ When multiple [-entry](#entry) options are present, each [-stage](#stage-1) asso
211
211
May be omitted if entry-point function has a \[shader(...)\] attribute; otherwise required for each [-entry](#entry) option.
212
212
213
213
214
-
<aid="target-1"></a>
214
+
<aid="target-2"></a>
215
215
### -target
216
216
217
-
**-target <[target](#target)>**
217
+
**-target <[target](#target-1)>**
218
218
219
219
Specifies the format in which code should be generated.
220
220
@@ -254,15 +254,15 @@ all - Treat all warnings as errors.
254
254
Disable specific warning ids.
255
255
256
256
257
-
<aid="W"></a>
257
+
<aid="w"></a>
258
258
### -W
259
259
260
260
**-W<id>**
261
261
262
262
Enable a warning with the specified id.
263
263
264
264
265
-
<aid="Wno"></a>
265
+
<aid="wno"></a>
266
266
### -Wno-
267
267
268
268
**-Wno-<id>**
@@ -377,7 +377,7 @@ Pack bitfields according to MSVC rules (msb first, new field when underlying typ
377
377
378
378
379
379
380
-
<aid="Target"></a>
380
+
<aid="target"></a>
381
381
## Target
382
382
383
383
Target code generation options
@@ -461,7 +461,7 @@ Sets how the `#line` directives should be produced. Available options are:
461
461
If not specified, default behavior is to use C-style `#line` directives for HLSL and C/C++ output, and traditional GLSL-style `#line` directives for GLSL output.
Pass arguments to downstream [<compiler>](#compiler). Just [-X<compiler>](#X) passes just the next argument to the downstream compiler. [-X<compiler>](#X)... options [-X](#X). will pass *all* of the options inbetween the opening [-X](#X) and [-X](#X). to the downstream compiler.
646
+
Pass arguments to downstream [<compiler>](#compiler). Just [-X<compiler>](#x) passes just the next argument to the downstream compiler. [-X<compiler>](#x)... options [-X](#x). will pass *all* of the options inbetween the opening [-X](#x) and [-X](#x). to the downstream compiler.
647
647
648
648
649
649
<aid="pass-through"></a>
@@ -657,7 +657,7 @@ These are intended for debugging/testing purposes, when you want to be able to s
657
657
658
658
659
659
660
-
<aid="Debugging"></a>
660
+
<aid="debugging"></a>
661
661
## Debugging
662
662
663
663
Compiler debugging/instrumentation options
@@ -690,7 +690,7 @@ Dump the IR after every pass for debugging.
690
690
Dump the IDs with [-dump-ir](#dump-ir) (debug builds only)
691
691
692
692
693
-
<aid="E"></a>
693
+
<aid="e"></a>
694
694
### -E, -output-preprocessor
695
695
Output the preprocessing result and exit.
696
696
@@ -767,7 +767,7 @@ Print the minimum and maximum module versions this compiler supports
767
767
768
768
769
769
770
-
<aid="Repro"></a>
770
+
<aid="repro"></a>
771
771
## Repro
772
772
773
773
Slang repro system related
@@ -827,7 +827,7 @@ There are two *special* directories:
827
827
828
828
829
829
830
-
<aid="Experimental"></a>
830
+
<aid="experimental"></a>
831
831
## Experimental
832
832
833
833
Experimental options (use at your own risk)
@@ -909,7 +909,7 @@ Control colored diagnostic output (auto uses color if stderr is a tty)
909
909
910
910
911
911
912
-
<aid="Internal"></a>
912
+
<aid="internal"></a>
913
913
## Internal
914
914
915
915
Internal-use options (use at your own risk)
@@ -1002,7 +1002,7 @@ Generate code for all entry points in a single output (library mode).
1002
1002
1003
1003
1004
1004
1005
-
<aid="Deprecated"></a>
1005
+
<aid="deprecated"></a>
1006
1006
## Deprecated
1007
1007
1008
1008
Deprecated options (allowed but ignored; may be removed in future)
0 commit comments