Skip to content

Commit 504cfaa

Browse files
authored
fix: improve spacing and rendering of array and structs details section [OPT-352] (#658)
The nested bullets was giving issues to to indents when using the collapsible blocks with arrays and structs. We fix the templates so that the rendering of details is cleaner. The main difference is that we are removing the bullets as that messes up the collapsible details section. Decoded Proposal looks like this now: ### Batch 0 **Chain selector:** `16015286601757825753` (ethereum-testnet-sepolia) #### Operation 0 **Address:** `0x88C6be3328DC0aa67d6E7E2Fd2245B35e6389030` <sub><i>address of ProposerManyChainMultiSig 1.0.0 from ethereum-testnet-sepolia</i></sub> **Method:** `function setConfig(address[] signerAddresses, uint8[] signerGroups, uint8[32] groupQuorums, uint8[32] groupParents, bool clearRoot) returns()` **Inputs:** **`signerAddresses`**: array[2]: [0x9cA1A1bAf18278Ed49FC25E35753768167959082, 0xAd5F37dB17a54eb3b8c6DE6774b3D410CE8AeDD5] <details> <summary>Details</summary> ```text [ 0: 0x9cA1A1bAf18278Ed49FC25E35753768167959082 1: 0xAd5F37dB17a54eb3b8c6DE6774b3D410CE8AeDD5 ] ``` </details> **`signerGroups`**: array[2]: [0, 0] <details> <summary>Details</summary> ```text [ 0: 0 1: 0 ] ``` </details> **`groupQuorums`**: array[32]: [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, … (+29)] <details> <summary>Details</summary> ```text [ 0: 1 1: 0 2: 0 3: 0 4: 0 5: 0 6: 0 7: 0 8: 0 9: 0 10: 0 11: 0 12: 0 13: 0 14: 0 15: 0 16: 0 17: 0 18: 0 19: 0 20: 0 21: 0 22: 0 23: 0 24: 0 25: 0 26: 0 27: 0 28: 0 29: 0 30: 0 31: 0 ] ``` </details> **`groupParents`**: array[32]: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, … (+29)] <details> <summary>Details</summary> ```text [ 0: 0 1: 0 2: 0 3: 0 4: 0 5: 0 6: 0 7: 0 8: 0 9: 0 10: 0 11: 0 12: 0 13: 0 14: 0 15: 0 16: 0 17: 0 18: 0 19: 0 20: 0 21: 0 22: 0 23: 0 24: 0 25: 0 26: 0 27: 0 28: 0 29: 0 30: 0 31: 0 ] ``` </details> **`clearRoot`**: `false` #### Operation 1 **Address:** `0xF5402d1B437D323E2F0d72874d14Ae9B1027A1a4` <sub><i>address of CancellerManyChainMultiSig 1.0.0 from ethereum-testnet-sepolia</i></sub> **Method:** `function setConfig(address[] signerAddresses, uint8[] signerGroups, uint8[32] groupQuorums, uint8[32] groupParents, bool clearRoot) returns()` **Inputs:** **`signerAddresses`**: array[2]: [0x9cA1A1bAf18278Ed49FC25E35753768167959082, 0xAd5F37dB17a54eb3b8c6DE6774b3D410CE8AeDD5] <details> <summary>Details</summary> ```text [ 0: 0x9cA1A1bAf18278Ed49FC25E35753768167959082 1: 0xAd5F37dB17a54eb3b8c6DE6774b3D410CE8AeDD5 ] ``` </details> **`signerGroups`**: array[2]: [0, 0] <details> <summary>Details</summary> ```text [ 0: 0 1: 0 ] ``` </details> **`groupQuorums`**: array[32]: [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, … (+29)] <details> <summary>Details</summary> ```text [ 0: 1 1: 0 2: 0 3: 0 4: 0 5: 0 6: 0 7: 0 8: 0 9: 0 10: 0 11: 0 12: 0 13: 0 14: 0 15: 0 16: 0 17: 0 18: 0 19: 0 20: 0 21: 0 22: 0 23: 0 24: 0 25: 0 26: 0 27: 0 28: 0 29: 0 30: 0 31: 0 ] ``` </details> **`groupParents`**: array[32]: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, … (+29)] <details> <summary>Details</summary> ```text [ 0: 0 1: 0 2: 0 3: 0 4: 0 5: 0 6: 0 7: 0 8: 0 9: 0 10: 0 11: 0 12: 0 13: 0 14: 0 15: 0 16: 0 17: 0 18: 0 19: 0 20: 0 21: 0 22: 0 23: 0 24: 0 25: 0 26: 0 27: 0 28: 0 29: 0 30: 0 31: 0 ] ``` </details> **`clearRoot`**: `false` #### Operation 2 **Address:** `0xF6899f4ddAd6cb52a58F031fA6A8a19a2AC1Bc5C` <sub><i>address of BypasserManyChainMultiSig 1.0.0 from ethereum-testnet-sepolia</i></sub> **Method:** `function setConfig(address[] signerAddresses, uint8[] signerGroups, uint8[32] groupQuorums, uint8[32] groupParents, bool clearRoot) returns()` **Inputs:** **`signerAddresses`**: array[2]: [0x9cA1A1bAf18278Ed49FC25E35753768167959082, 0xAd5F37dB17a54eb3b8c6DE6774b3D410CE8AeDD5] <details> <summary>Details</summary> ```text [ 0: 0x9cA1A1bAf18278Ed49FC25E35753768167959082 1: 0xAd5F37dB17a54eb3b8c6DE6774b3D410CE8AeDD5 ] ``` </details> **`signerGroups`**: array[2]: [0, 0] <details> <summary>Details</summary> ```text [ 0: 0 1: 0 ] ``` </details> **`groupQuorums`**: array[32]: [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, … (+29)] <details> <summary>Details</summary> ```text [ 0: 1 1: 0 2: 0 3: 0 4: 0 5: 0 6: 0 7: 0 8: 0 9: 0 10: 0 11: 0 12: 0 13: 0 14: 0 15: 0 16: 0 17: 0 18: 0 19: 0 20: 0 21: 0 22: 0 23: 0 24: 0 25: 0 26: 0 27: 0 28: 0 29: 0 30: 0 31: 0 ] ``` </details> **`groupParents`**: array[32]: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, … (+29)] <details> <summary>Details</summary> ```text [ 0: 0 1: 0 2: 0 3: 0 4: 0 5: 0 6: 0 7: 0 8: 0 9: 0 10: 0 11: 0 12: 0 13: 0 14: 0 15: 0 16: 0 17: 0 18: 0 19: 0 20: 0 21: 0 22: 0 23: 0 24: 0 25: 0 26: 0 27: 0 28: 0 29: 0 30: 0 31: 0 ] ``` </details> **`clearRoot`**: `false` --- ### Batch 1 **Chain selector:** `13264668187771770619` (binance_smart_chain-testnet) #### Operation 0 **Address:** `0x88C6be3328DC0aa67d6E7E2Fd2245B35e6389030` <sub><i>address of ProposerManyChainMultiSig 1.0.0 from ethereum-testnet-sepolia</i></sub> **Method:** `function setConfig(address[] signerAddresses, uint8[] signerGroups, uint8[32] groupQuorums, uint8[32] groupParents, bool clearRoot) returns()` **Inputs:** **`signerAddresses`**: array[2]: [0x9cA1A1bAf18278Ed49FC25E35753768167959082, 0xAd5F37dB17a54eb3b8c6DE6774b3D410CE8AeDD5] <details> <summary>Details</summary> ```text [ 0: 0x9cA1A1bAf18278Ed49FC25E35753768167959082 1: 0xAd5F37dB17a54eb3b8c6DE6774b3D410CE8AeDD5 ] ``` </details> **`signerGroups`**: array[2]: [0, 0] <details> <summary>Details</summary> ```text [ 0: 0 1: 0 ] ``` </details> **`groupQuorums`**: array[32]: [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, … (+29)] <details> <summary>Details</summary> ```text [ 0: 1 1: 0 2: 0 3: 0 4: 0 5: 0 6: 0 7: 0 8: 0 9: 0 10: 0 11: 0 12: 0 13: 0 14: 0 15: 0 16: 0 17: 0 18: 0 19: 0 20: 0 21: 0 22: 0 23: 0 24: 0 25: 0 26: 0 27: 0 28: 0 29: 0 30: 0 31: 0 ] ``` </details> **`groupParents`**: array[32]: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, … (+29)] <details> <summary>Details</summary> ```text [ 0: 0 1: 0 2: 0 3: 0 4: 0 5: 0 6: 0 7: 0 8: 0 9: 0 10: 0 11: 0 12: 0 13: 0 14: 0 15: 0 16: 0 17: 0 18: 0 19: 0 20: 0 21: 0 22: 0 23: 0 24: 0 25: 0 26: 0 27: 0 28: 0 29: 0 30: 0 31: 0 ] ``` </details> **`clearRoot`**: `false` #### Operation 1 **Address:** `0xF5402d1B437D323E2F0d72874d14Ae9B1027A1a4` <sub><i>address of CancellerManyChainMultiSig 1.0.0 from ethereum-testnet-sepolia</i></sub> **Method:** `function setConfig(address[] signerAddresses, uint8[] signerGroups, uint8[32] groupQuorums, uint8[32] groupParents, bool clearRoot) returns()` **Inputs:** **`signerAddresses`**: array[2]: [0x9cA1A1bAf18278Ed49FC25E35753768167959082, 0xAd5F37dB17a54eb3b8c6DE6774b3D410CE8AeDD5] <details> <summary>Details</summary> ```text [ 0: 0x9cA1A1bAf18278Ed49FC25E35753768167959082 1: 0xAd5F37dB17a54eb3b8c6DE6774b3D410CE8AeDD5 ] ``` </details> **`signerGroups`**: array[2]: [0, 0] <details> <summary>Details</summary> ```text [ 0: 0 1: 0 ] ``` </details> **`groupQuorums`**: array[32]: [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, … (+29)] <details> <summary>Details</summary> ```text [ 0: 1 1: 0 2: 0 3: 0 4: 0 5: 0 6: 0 7: 0 8: 0 9: 0 10: 0 11: 0 12: 0 13: 0 14: 0 15: 0 16: 0 17: 0 18: 0 19: 0 20: 0 21: 0 22: 0 23: 0 24: 0 25: 0 26: 0 27: 0 28: 0 29: 0 30: 0 31: 0 ] ``` </details> **`groupParents`**: array[32]: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, … (+29)] <details> <summary>Details</summary> ```text [ 0: 0 1: 0 2: 0 3: 0 4: 0 5: 0 6: 0 7: 0 8: 0 9: 0 10: 0 11: 0 12: 0 13: 0 14: 0 15: 0 16: 0 17: 0 18: 0 19: 0 20: 0 21: 0 22: 0 23: 0 24: 0 25: 0 26: 0 27: 0 28: 0 29: 0 30: 0 31: 0 ] ``` </details> **`clearRoot`**: `false` #### Operation 2 **Address:** `0xF6899f4ddAd6cb52a58F031fA6A8a19a2AC1Bc5C` <sub><i>address of BypasserManyChainMultiSig 1.0.0 from ethereum-testnet-sepolia</i></sub> **Method:** `function setConfig(address[] signerAddresses, uint8[] signerGroups, uint8[32] groupQuorums, uint8[32] groupParents, bool clearRoot) returns()` **Inputs:** **`signerAddresses`**: array[2]: [0x9cA1A1bAf18278Ed49FC25E35753768167959082, 0xAd5F37dB17a54eb3b8c6DE6774b3D410CE8AeDD5] <details> <summary>Details</summary> ```text [ 0: 0x9cA1A1bAf18278Ed49FC25E35753768167959082 1: 0xAd5F37dB17a54eb3b8c6DE6774b3D410CE8AeDD5 ] ``` </details> **`signerGroups`**: array[2]: [0, 0] <details> <summary>Details</summary> ```text [ 0: 0 1: 0 ] ``` </details> **`groupQuorums`**: array[32]: [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, … (+29)] <details> <summary>Details</summary> ```text [ 0: 1 1: 0 2: 0 3: 0 4: 0 5: 0 6: 0 7: 0 8: 0 9: 0 10: 0 11: 0 12: 0 13: 0 14: 0 15: 0 16: 0 17: 0 18: 0 19: 0 20: 0 21: 0 22: 0 23: 0 24: 0 25: 0 26: 0 27: 0 28: 0 29: 0 30: 0 31: 0 ] ``` </details> **`groupParents`**: array[32]: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, … (+29)] <details> <summary>Details</summary> ```text [ 0: 0 1: 0 2: 0 3: 0 4: 0 5: 0 6: 0 7: 0 8: 0 9: 0 10: 0 11: 0 12: 0 13: 0 14: 0 15: 0 16: 0 17: 0 18: 0 19: 0 20: 0 21: 0 22: 0 23: 0 24: 0 25: 0 26: 0 27: 0 28: 0 29: 0 30: 0 31: 0 ] ``` </details> **`clearRoot`**: `false` ---
1 parent 35112af commit 504cfaa

File tree

4 files changed

+129
-33
lines changed

4 files changed

+129
-33
lines changed

.changeset/purple-trams-sort.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"chainlink-deployments-framework": patch
3+
---
4+
5+
fix proposal analyzer render issues with array details

experimental/analyzer/renderer_markdown_test.go

Lines changed: 108 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ func TestMarkdownRenderer_RenderDecodedCall_SimpleCall(t *testing.T) {
3434
assert.Contains(t, output, "**Address:** `0x1234567890123456789012345678901234567890`")
3535
assert.Contains(t, output, "**Method:** `transfer(address,uint256)`")
3636
assert.Contains(t, output, "**Inputs:**")
37-
assert.Contains(t, output, "- `to`: `0xabcdefabcdefabcdefabcdefabcdefabcdefabcd`")
38-
assert.Contains(t, output, "- `amount`: `1000000000000000000`")
37+
assert.Contains(t, output, "**`to`**: `0xabcdefabcdefabcdefabcdefabcdefabcdefabcd`")
38+
assert.Contains(t, output, "**`amount`**: `1000000000000000000`")
3939
assert.NotContains(t, output, "**Outputs:**")
4040
}
4141

@@ -64,9 +64,9 @@ func TestMarkdownRenderer_RenderDecodedCall_WithOutputs(t *testing.T) {
6464
output := renderer.RenderDecodedCall(call, ctx)
6565

6666
assert.Contains(t, output, "**Inputs:**")
67-
assert.Contains(t, output, "- `account`: `0xabcdefabcdefabcdefabcdefabcdefabcdefabcd`")
67+
assert.Contains(t, output, "**`account`**: `0xabcdefabcdefabcdefabcdefabcdefabcdefabcd`")
6868
assert.Contains(t, output, "**Outputs:**")
69-
assert.Contains(t, output, "- `balance`: `5000000000000000000`")
69+
assert.Contains(t, output, "**`balance`**: `5000000000000000000`")
7070
}
7171

7272
func TestMarkdownRenderer_RenderDecodedCall_WithAddressAnnotation(t *testing.T) {
@@ -113,6 +113,73 @@ func TestMarkdownRenderer_RenderDecodedCall_EmptyInputsOutputs(t *testing.T) {
113113
assert.NotContains(t, output, "**Outputs:**")
114114
}
115115

116+
func TestMarkdownRenderer_RenderDecodedCall_TopLevelBlocks_NoListIndentation(t *testing.T) {
117+
t.Parallel()
118+
119+
renderer := NewMarkdownRenderer()
120+
call := &DecodedCall{
121+
Address: "0x88C6be3328DC0aa67d6E7E2Fd2245B35e6389030",
122+
Method: "setConfig(address[],uint8[],uint8[32],uint8[32],bool)",
123+
Inputs: []NamedField{
124+
{
125+
Name: "signerAddresses",
126+
Value: ArrayField{Elements: []FieldValue{
127+
AddressField{Value: "0x9cA1A1bAf18278Ed49FC25E35753768167959082"},
128+
AddressField{Value: "0xAd5F37dB17a54eb3b8c6DE6774b3D410CE8AeDD5"},
129+
}},
130+
},
131+
{
132+
Name: "signerGroups",
133+
Value: ArrayField{Elements: []FieldValue{
134+
SimpleField{Value: "0"},
135+
SimpleField{Value: "0"},
136+
}},
137+
},
138+
{
139+
Name: "groupQuorums",
140+
Value: ArrayField{Elements: []FieldValue{
141+
SimpleField{Value: "1"},
142+
SimpleField{Value: "0"},
143+
SimpleField{Value: "0"},
144+
SimpleField{Value: "0"},
145+
}},
146+
},
147+
{
148+
Name: "groupParents",
149+
Value: ArrayField{Elements: []FieldValue{
150+
SimpleField{Value: "0"},
151+
SimpleField{Value: "0"},
152+
SimpleField{Value: "0"},
153+
SimpleField{Value: "0"},
154+
}},
155+
},
156+
{
157+
Name: "clearRoot",
158+
Value: SimpleField{Value: "false"},
159+
},
160+
},
161+
Outputs: []NamedField{},
162+
}
163+
164+
ctx := NewFieldContext(nil)
165+
output := renderer.RenderDecodedCall(call, ctx)
166+
167+
// New format should not emit nested list markers for inputs.
168+
assert.NotContains(t, output, "\n - `")
169+
// Details should start at column 0, not indented under a list.
170+
assert.Contains(t, output, "\n<details>")
171+
assert.NotContains(t, output, "\n <details>")
172+
173+
// key inputs should be present and use top-level blocks.
174+
assert.Contains(t, output, "**`signerAddresses`**:")
175+
assert.Contains(t, output, "**`groupQuorums`**:")
176+
177+
// Details wrapper should use a summary + fenced code (GitHub-stable).
178+
assert.Contains(t, output, "<summary>Details</summary>")
179+
assert.Contains(t, output, "```text")
180+
assert.Contains(t, output, "</details>")
181+
}
182+
116183
// Tests for MarkdownRenderer descriptor handling methods
117184

118185
func TestMarkdownRenderer_SummarizeArgument_SimpleField(t *testing.T) {
@@ -131,8 +198,9 @@ func TestMarkdownRenderer_SummarizeArgument_SimpleField(t *testing.T) {
131198
summary, details = renderer.summarizeField("longName", SimpleField{Value: longValue}, ctx)
132199
assert.Contains(t, summary, "`this is a very long string that should …cause it exceeds the 80 character limit` (len=")
133200
assert.Contains(t, details, "<details>")
134-
assert.Contains(t, details, "<pre><code>")
135-
assert.Contains(t, details, "</code></pre>")
201+
assert.Contains(t, details, "<summary>Details</summary>")
202+
assert.Contains(t, details, "```text")
203+
assert.Contains(t, details, "```")
136204
assert.Contains(t, details, "</details>")
137205
assert.Contains(t, details, longValue)
138206
}
@@ -170,8 +238,9 @@ func TestMarkdownRenderer_SummarizeArgument_BytesField(t *testing.T) {
170238
summary, details := renderer.summarizeField("small", BytesField{Value: smallBytes}, ctx)
171239
assert.Contains(t, summary, "bytes(len=3):")
172240
assert.Contains(t, details, "<details>")
173-
assert.Contains(t, details, "<pre><code>")
174-
assert.Contains(t, details, "</code></pre>")
241+
assert.Contains(t, details, "<summary>Details</summary>")
242+
assert.Contains(t, details, "```text")
243+
assert.Contains(t, details, "```")
175244
assert.Contains(t, details, "</details>")
176245
assert.Contains(t, details, "0x010203")
177246

@@ -183,8 +252,9 @@ func TestMarkdownRenderer_SummarizeArgument_BytesField(t *testing.T) {
183252
summary, details = renderer.summarizeField("large", BytesField{Value: largeBytes}, ctx)
184253
assert.Contains(t, summary, "bytes(len=50):")
185254
assert.Contains(t, details, "<details>")
186-
assert.Contains(t, details, "<pre><code>")
187-
assert.Contains(t, details, "</code></pre>")
255+
assert.Contains(t, details, "<summary>Details</summary>")
256+
assert.Contains(t, details, "```text")
257+
assert.Contains(t, details, "```")
188258
assert.Contains(t, details, "</details>")
189259
}
190260

@@ -208,8 +278,9 @@ func TestMarkdownRenderer_SummarizeArgument_ArrayField(t *testing.T) {
208278
summary, details = renderer.summarizeField("array", ArrayField{Elements: elements}, ctx)
209279
assert.Contains(t, summary, "array[3]")
210280
assert.Contains(t, details, "<details>")
211-
assert.Contains(t, details, "<pre><code>")
212-
assert.Contains(t, details, "</code></pre>")
281+
assert.Contains(t, details, "<summary>Details</summary>")
282+
assert.Contains(t, details, "```text")
283+
assert.Contains(t, details, "```")
213284
assert.Contains(t, details, "</details>")
214285
}
215286

@@ -226,8 +297,9 @@ func TestMarkdownRenderer_SummarizeArgument_StructField(t *testing.T) {
226297
summary, details := renderer.summarizeField("struct", StructField{Fields: fields}, ctx)
227298
assert.Contains(t, summary, "struct{ 2 fields }")
228299
assert.Contains(t, details, "<details>")
229-
assert.Contains(t, details, "<pre><code>")
230-
assert.Contains(t, details, "</code></pre>")
300+
assert.Contains(t, details, "<summary>Details</summary>")
301+
assert.Contains(t, details, "```text")
302+
assert.Contains(t, details, "```")
231303
assert.Contains(t, details, "</details>")
232304
// Test that details contain actual field content, not just the summary
233305
assert.Contains(t, details, "field1: value1")
@@ -253,8 +325,9 @@ func TestMarkdownRenderer_SummarizeArgument_ArrayField_Details(t *testing.T) {
253325

254326
// Test that details contain actual array content, not just the summary
255327
assert.Contains(t, details, "<details>")
256-
assert.Contains(t, details, "<pre><code>")
257-
assert.Contains(t, details, "</code></pre>")
328+
assert.Contains(t, details, "<summary>Details</summary>")
329+
assert.Contains(t, details, "```text")
330+
assert.Contains(t, details, "```")
258331
assert.Contains(t, details, "</details>")
259332
assert.Contains(t, details, "item1")
260333
assert.Contains(t, details, "item2")
@@ -277,8 +350,9 @@ func TestMarkdownRenderer_SummarizeArgument_StructField_Empty(t *testing.T) {
277350

278351
// Test that details show the appropriate message for empty struct
279352
assert.Contains(t, details, "<details>")
280-
assert.Contains(t, details, "<pre><code>")
281-
assert.Contains(t, details, "</code></pre>")
353+
assert.Contains(t, details, "<summary>Details</summary>")
354+
assert.Contains(t, details, "```text")
355+
assert.Contains(t, details, "```")
282356
assert.Contains(t, details, "</details>")
283357
assert.Contains(t, details, "struct with 0 fields (no field data available)")
284358
}
@@ -301,8 +375,9 @@ func TestMarkdownRenderer_StructDetail(t *testing.T) {
301375
assert.Contains(t, summary, "struct{ 2 fields }")
302376

303377
assert.Contains(t, details, "<details>")
304-
assert.Contains(t, details, "<pre><code>")
305-
assert.Contains(t, details, "</code></pre>")
378+
assert.Contains(t, details, "<summary>Details</summary>")
379+
assert.Contains(t, details, "```text")
380+
assert.Contains(t, details, "```")
306381
assert.Contains(t, details, "</details>")
307382

308383
// details should contain actual field content
@@ -346,8 +421,9 @@ func TestMarkdownRenderer_ArrayField_WithStructElement(t *testing.T) {
346421

347422
// Details should show FULL nested content in GitHub Flavored Markdown collapsible section
348423
assert.Contains(t, details, "<details>")
349-
assert.Contains(t, details, "<pre><code>")
350-
assert.Contains(t, details, "</code></pre>")
424+
assert.Contains(t, details, "<summary>Details</summary>")
425+
assert.Contains(t, details, "```text")
426+
assert.Contains(t, details, "```")
351427
assert.Contains(t, details, "</details>")
352428

353429
// Should show the outer struct fields
@@ -359,8 +435,8 @@ func TestMarkdownRenderer_ArrayField_WithStructElement(t *testing.T) {
359435
assert.Contains(t, details, "FChain: someValue")
360436
assert.Contains(t, details, "Config:")
361437

362-
assert.Contains(t, details, "<pre><code>")
363-
assert.Contains(t, details, "</code></pre>")
438+
assert.Contains(t, details, "```text")
439+
assert.Contains(t, details, "```")
364440
assert.Contains(t, details, "</details>")
365441

366442
// Details should NOT contain just the summary
@@ -382,8 +458,9 @@ func TestMarkdownRenderer_StructField_EmptyFields(t *testing.T) {
382458

383459
// Details should show appropriate message for empty struct
384460
assert.Contains(t, details, "<details>")
385-
assert.Contains(t, details, "<pre><code>")
386-
assert.Contains(t, details, "</code></pre>")
461+
assert.Contains(t, details, "<summary>Details</summary>")
462+
assert.Contains(t, details, "```text")
463+
assert.Contains(t, details, "```")
387464
assert.Contains(t, details, "</details>")
388465
assert.Contains(t, details, "struct with 0 fields (no field data available)")
389466
}
@@ -444,8 +521,11 @@ func TestMarkdownRenderer_YamlField_PrettyPrinting(t *testing.T) {
444521
assert.Contains(t, summary, "signer: false")
445522

446523
// Details should show pretty-printed YAML with proper indentation
447-
assert.Contains(t, details, "<details><pre><code>")
448-
assert.Contains(t, details, "</code></pre></details>")
524+
assert.Contains(t, details, "<details>")
525+
assert.Contains(t, details, "<summary>Details</summary>")
526+
assert.Contains(t, details, "```text")
527+
assert.Contains(t, details, "```")
528+
assert.Contains(t, details, "</details>")
449529

450530
// Should contain the YAML structure with proper formatting and html espaced strings &#45 for dashes "-"
451531
assert.Contains(t, details, "items:")

experimental/analyzer/templates/markdown/decoded_call.tmpl

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,14 @@
33

44
{{if .Inputs}}**Inputs:**
55

6-
{{range .Inputs}} - `{{.Name}}`: {{.Summary}}{{if .Annotation}} <sub><i>{{.Annotation}}</i></sub>{{end}}{{if .Details}}
7-
- {{.Details}}{{end}}
6+
{{range .Inputs}}
7+
**`{{.Name}}`**: {{.Summary}}{{if .Annotation}} <sub><i>{{.Annotation}}</i></sub>{{end}}
8+
9+
{{if .Details}}{{.Details}}{{end}}
810
{{end}}{{end}}{{if .Outputs}}**Outputs:**
911

10-
{{range .Outputs}} - `{{.Name}}`: {{.Summary}}{{if .Annotation}} <sub><i>{{.Annotation}}</i></sub>{{end}}{{if .Details}}
11-
- {{.Details}}{{end}}
12+
{{range .Outputs}}
13+
**`{{.Name}}`**: {{.Summary}}{{if .Annotation}} <sub><i>{{.Annotation}}</i></sub>{{end}}
14+
15+
{{if .Details}}{{.Details}}{{end}}
1216
{{end}}{{end}}
Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,8 @@
1-
<details><pre><code>{{.Content}}</code></pre></details>
1+
<details>
2+
<summary>Details</summary>
3+
4+
```text
5+
{{.Content}}
6+
```
7+
8+
</details>

0 commit comments

Comments
 (0)