fix(docs): render Markdown in page titles#372
Merged
Conversation
docmd derives the page title from the first Markdown H1 but keeps the raw text, so a heading like `# `rsigma engine discover-schemas`` left literal backticks in the header bar, the <title>, and the Open Graph / Twitter meta. The post-build hook now renders the inline-code span as <code> in the visible header (matching the in-body H1) and strips the markers from the plain-text <title> and social meta. Titles without backticks are untouched.
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.
Problem
On pages whose first heading is inline code, for example
# `rsigma engine discover-schemas`, the top-of-page title rendered the raw Markdown, so literal backticks showed in the header bar (and in the<title>and social meta). docmd derives the page title from the first H1 but keeps the raw text; the in-body H1 renders correctly, only the derived title does not.Fix
The local
docmd-plugin-rsigmapost-build hook now normalizes derived titles per page:<span class="header-title">renders the inline-code span as<code>, matching the in-body H1;<title>and the Open Graph / Twittertitlemeta strip the backticks (HTML does not render there).Pages whose title has no backticks are left untouched (this build reported 40 titles rendered).
docmd buildanddocmd validatepass.Before / after
Header bar for
cli/engine/discover-schemas:`rsigma engine discover-schemas`rsigma engine discover-schemas(rendered as<code>)