Strip Bump HTML from API operation descriptions - #4045
Open
reakaleek wants to merge 2 commits into
Open
Conversation
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>
Docs preview (local build)Handbook preview: https://docs-v3-preview.elastic.dev/elastic/docs-builder/pull/4045/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
IMPORTANTmarkers 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 throughApiMarkdownwithout stripping it. Search export already removed the HTML island. The Paths section already lists every method and path fromOverloads.Closes elastic/docs-eng-team#812
What
Shared description cleaner
ApiMarkdown.Cleandrops the Bump path-list HTML and rewrites line-startNOTE,TIP,WARNING,IMPORTANT, andCAUTIONprefixes to Myst fences.CAUTIONmaps to{warning}because Myst does not support{caution}. The function is idempotent.Preparestill 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 leftoveroperation-verbsource, Myst rewrite, and idempotence. Emission tests assert the Paths list still showsPOST/{index}/_search. The CloudFront exporter check is replaced with an in-memory spec.Verify
Out of scope: These tests use
PassthroughMarkdownRenderer, so they prove the Myst fence in markdown, not a renderedadmonition importantdiv. Existing Markdown admonition tests cover that render path. A wrappedIMPORTANT:body with no blank line stays prose.Made with Cursor