Skip to content

fix: escape titles, keep preserved components, scope logLevel per instance - #86

Merged
rachfop merged 2 commits into
mainfrom
fix/small-fixes
Oct 2, 2026
Merged

rachfop merged 2 commits into
mainfrom
fix/small-fixes

Conversation

@rachfop

@rachfop rachfop commented Oct 2, 2026

Copy link
Copy Markdown
Owner

Smaller output and configuration bugs:

  • preserveComponents couldn't keep components named like HTML tags (<Table>) or TabItem. HTML tags now match lowercase names only, and the TabItem rewrite honors the list.
  • TabItem labels kept braces' quotes (label={"Python"}) and read data-label as label.
  • Titles containing ], newlines, or link syntax broke llms.txt lines. Link text is escaped and collapsed to one line, and ## headings stay on one line.
  • A body description from a hard-wrapped paragraph was cut at the first line break. Lines are joined before the 150-character cut, links keep their text only, and a cut never leaves a link or code span open.
  • Blog posts appeared under the last docs section's heading; they get a ## Blog heading when there are several sections.
  • useRelativeUrls, rewriteImageUrls, and warnOnIgnoredFiles weren't type-checked, so 'false' counted as true.
  • With two plugin instances, the last one's logLevel applied to both. Each postBuild now runs with its own level.
  • Duplicate page headings get a space before the suffix: ## Install (Api), not ## Install(Api).
  • Relative images without ./, in angle brackets, or percent-encoded weren't rewritten.

tests/test-small-fixes.js covers each case. tests/test-output-assembly.js now expects the spaced heading suffix. The docs site build output is unchanged; on a 3,461-page docs site, the differences are the heading suffix space and longer descriptions, with no prose lost.

…tance

- preserveComponents keeps HTML-named components (<Table>) and TabItem;
  HTML tag stripping matches lowercase element names only
- TabItem label: anchor attribute names on whitespace (data-label is not
  label) and unwrap string literals in braces (label={"x"})
- collapse titles to one line in llms.txt links and headings, and escape
  \, [, ] in link text
- join a hard-wrapped first-paragraph description before TOC truncation;
  normalize whitespace in TOC descriptions
- group blog posts under a Blog heading on multi-section sites
- validate useRelativeUrls, rewriteImageUrls, warnOnIgnoredFiles as booleans
- run each instance's postBuild under its own logLevel (AsyncLocalStorage),
  since Docusaurus runs postBuild hooks concurrently
- put a space before duplicate-heading suffixes: 'Guide (Install)'
- rewriteImageUrls: handle paths without ./, angle-bracket destinations,
  and percent-encoded paths
Joining hard-wrapped first paragraphs made long body descriptions reach
the 150-character cut more often, and the cut could land inside a link or
an inline code span. Body descriptions now keep link text only, and a cut
that would leave a `[` or backtick open moves before it. Descriptions
with nothing open keep the same 147-character cut.
@rachfop
rachfop merged commit 48be276 into main Oct 2, 2026
5 checks passed
@rachfop
rachfop deleted the fix/small-fixes branch October 2, 2026 23:05
rachfop added a commit that referenced this pull request Oct 2, 2026
…tance (#86)

* fix: escape titles, keep preserved components, scope logLevel per instance

- preserveComponents keeps HTML-named components (<Table>) and TabItem;
  HTML tag stripping matches lowercase element names only
- TabItem label: anchor attribute names on whitespace (data-label is not
  label) and unwrap string literals in braces (label={"x"})
- collapse titles to one line in llms.txt links and headings, and escape
  \, [, ] in link text
- join a hard-wrapped first-paragraph description before TOC truncation;
  normalize whitespace in TOC descriptions
- group blog posts under a Blog heading on multi-section sites
- validate useRelativeUrls, rewriteImageUrls, warnOnIgnoredFiles as booleans
- run each instance's postBuild under its own logLevel (AsyncLocalStorage),
  since Docusaurus runs postBuild hooks concurrently
- put a space before duplicate-heading suffixes: 'Guide (Install)'
- rewriteImageUrls: handle paths without ./, angle-bracket destinations,
  and percent-encoded paths

* fix: keep truncated TOC descriptions from leaving links or code open

Joining hard-wrapped first paragraphs made long body descriptions reach
the 150-character cut more often, and the cut could land inside a link or
an inline code span. Body descriptions now keep link text only, and a cut
that would leave a `[` or backtick open moves before it. Descriptions
with nothing open keep the same 147-character cut.
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.

1 participant