Skip to content

render dashboards as collapsible tables#3518

Draft
jakubgalecki0 wants to merge 4 commits into
elastic:mainfrom
jakubgalecki0:render_dashboard
Draft

render dashboards as collapsible tables#3518
jakubgalecki0 wants to merge 4 commits into
elastic:mainfrom
jakubgalecki0:render_dashboard

Conversation

@jakubgalecki0

Copy link
Copy Markdown
Contributor

No description provided.

return builder.String(), nil
}

func renderDashboardsCollapsibleTable(builder *strings.Builder, dashboards []dashboard) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium docs/dashboards.go:78

The escaper replaces *, {, }, <, > but not |, so pipe characters in dashboard titles or descriptions break the markdown table. A title like "CPU | Memory" produces an extra table column, corrupting the layout. Add | to the escaper replacement list.

 var escaper = strings.NewReplacer("*", "\\*", "{", "\\{", "}", "\\}", "<", "\\<", ">", "\\>")
🤖 Copy this AI Prompt to have your agent fix this:
In file internal/docs/dashboards.go around line 78:

The `escaper` replaces `*`, `{`, `}`, `<`, `>` but not `|`, so pipe characters in dashboard titles or descriptions break the markdown table. A title like "CPU | Memory" produces an extra table column, corrupting the layout. Add `|` to the escaper replacement list.

Evidence trail:
internal/docs/exported_fields.go:25 (escaper definition: `strings.NewReplacer("*", "\\*", "{", "\\{", "}", "\\}", "<", "\\<", ">", "\\>")` — no `|`), internal/docs/dashboards.go:78-88 (markdown table rendering using `escaper.Replace(title)` and `escaper.Replace(description)` within pipe-delimited rows)

@elasticmachine

elasticmachine commented May 12, 2026

Copy link
Copy Markdown
Contributor

💔 Build Failed

Failed CI Steps

History

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants