Skip to content

Strip Bump HTML from API operation descriptions - #4045

Open
reakaleek wants to merge 2 commits into
mainfrom
feat/812-clean-operation-html
Open

Strip Bump HTML from API operation descriptions#4045
reakaleek wants to merge 2 commits into
mainfrom
feat/812-clean-operation-html

Conversation

@reakaleek

Copy link
Copy Markdown
Member

Operation pages no longer show Bump path-list HTML or a literal IMPORTANT: prefix. Those descriptions become Myst callouts, and the Paths list still comes from overloads.

Affects: API reference, Search

Prompt summary: Implement elastic/docs-eng-team#812. Strip leaked Bump HTML from operation descriptions and map IMPORTANT markers to Myst admonitions so the page matches search export.

Why

Spec descriptions include a Bump "All methods and paths" HTML block and Asciidoc prefixes such as IMPORTANT:. Page render sent that string through ApiMarkdown without stripping it. Search export already removed the HTML island. The Paths section already lists every method and path from Overloads.

Closes elastic/docs-eng-team#812

What

Shared description cleaner

ApiMarkdown.Clean drops the Bump path-list HTML and rewrites line-start NOTE, TIP, WARNING, IMPORTANT, and CAUTION prefixes to Myst fences. CAUTION maps to {warning} because Myst does not support {caution}. The function is idempotent. Prepare still only escapes mustache tokens and rewrites intra-API links, so parameter and property text stay unchanged.

Page and search call sites

The operation page model and front matter store the cleaned description. An HTML-only description no longer creates an empty Description section. Search export calls the same cleaner and no longer rebuilds a markdown method list. Each search document already has Method and Path fields. The Description wrapper is a div, so lists and callouts are valid HTML.

Tests

A fixture search description now includes the leaked HTML snippet and an IMPORTANT: line. Unit tests assert no leftover operation-verb source, Myst rewrite, and idempotence. Emission tests assert the Paths list still shows POST /{index}/_search. The CloudFront exporter check is replaced with an in-memory spec.

Verify

dotnet test tests/Elastic.ApiExplorer.Tests/
# Clean_BumpIslandAndImportant_StripsHtmlAndRewritesAdmonition
# ConvertToDocuments_DescriptionWithBumpHtml_LeavesNoHtmlAndNoRebuiltList

Out of scope: These tests use PassthroughMarkdownRenderer, so they prove the Myst fence in markdown, not a rendered admonition important div. Existing Markdown admonition tests cover that render path. A wrapped IMPORTANT: body with no blank line stays prose.

Made with Cursor

Page render left Bump path-list markup and IMPORTANT prefixes in the description. Search export already stripped that HTML. Share one cleaner so both paths drop the island and map callouts to Myst.

Co-Authored-By: Cursor Grok 4.6 <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
The signature, empty-on-null guard, and Clean_AlreadyClean_IsIdempotent already document this.

Co-Authored-By: Cursor Grok 4.6 <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown

Docs preview (local build)

Handbook preview: https://docs-v3-preview.elastic.dev/elastic/docs-builder/pull/4045/

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant