Skip to content

fix: add GFM table support, anchor links, and release tag display to RemoteMD#411

Open
web3jenks wants to merge 8 commits intomainfrom
fix/153-table-display-remotemd
Open

fix: add GFM table support, anchor links, and release tag display to RemoteMD#411
web3jenks wants to merge 8 commits intomainfrom
fix/153-table-display-remotemd

Conversation

@web3jenks
Copy link
Copy Markdown
Collaborator

Summary

Fixes multiple issues with the RemoteMD component that renders documentation fetched from external GitHub repositories:

Changes

GFM Table Support

  • Added remark-gfm plugin to enable GitHub Flavored Markdown table rendering
  • Added rehype-raw and rehype-sanitize plugins for safe HTML passthrough
  • Added .remote-md-table-wrapper with horizontal scroll for wide tables on mobile

Anchor Links on Headings

  • All heading levels (h1–h6) now render with clickable anchor links (# on hover)
  • HeadingWithAnchor component generates stable, unique IDs (handles duplicates with -1, -2 suffix)
  • On page load, scrolls to the URL hash target after content renders
  • CSS hover effect shows # indicator to the left of headings

Release Tag Display

  • Single-release pages now display the tag as static text instead of hiding it
  • Added releasesLoaded state to prevent flash of empty content while releases load
  • Wrapped GitHub API call in try/catch so the component gracefully falls back to rawUrl

Dependency Changes

  • Added: react-markdown@^8.0.7, rehype-raw@^6.1.1, remark-gfm@^3.0.1
  • Changed: rehype-sanitize from ^6.0.0^5.0.1 (compatibility with rehype-raw)

Test plan

  • Verify tables render correctly on remote markdown pages (e.g., Finality Provider docs)
  • Verify tables scroll horizontally on narrow viewports
  • Verify heading anchor links appear on hover and update the URL hash on click
  • Verify deep links (URLs with #heading-id) scroll to the correct heading after load
  • Verify release tag dropdown works when multiple versions are available
  • Verify release tag displays as static text when only one version exists
  • Verify pages without releaseVersions prop still render correctly
  • Run npm run build to confirm no broken links

🤖 Generated with Claude Code

web3jenks and others added 5 commits February 18, 2026 06:10
* content: remove Pioneer Pass page and clean up EVM references

Closes #379 - Remove Pioneer Pass Airdrop Page
Closes #376 - Remove EVM references in docs

Changes:
- Remove entire campaigns/ folder containing pioneer_nfts.mdx
- Remove EVM-Compatible dApps bullet from mainnet overview (EVM not yet launched)
- Remove "supporting robust EVM primitives" language from control plane description
- Remove EVM Chain ID row from devnet chain information table
- Note: Auto-generated API docs still contain EVM in schema descriptions
  (these come from upstream OpenAPI specs and should be updated there)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* docs: remove staking
  campaigns references from CLAUDE.md

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Replace indefinite localStorage retention with a two-calendar-month
expiry that matches the backend's data retention policy. Sessions are
pruned on load. Also removes legacy migration code for the old
babylon_ai_chat_history key and fixes a missing space in the
token-limit error message.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
…RemoteMD

Fixes #153 - Tables not displaying properly in remote markdown pages
Fixes #205 - Release tag not showing when releaseVersions prop is omitted
Fixes #192 - Anchor links now work on RemoteMD headings with deep linking

Changes:
- Add remark-gfm plugin to ReactMarkdown for proper table rendering
- Add rehype-raw plugin for inline HTML support (e.g., <br> in tables)
- Add responsive table overflow (display:block + overflow-x:auto)
- Fix h1 counter bug (was resetting every render, hiding ALL h1s)
- Add clickable anchor links (#) on hover for h1-h3 headings
- Add scroll-to-hash effect after async markdown loads
- Show release tag badge even with single release (was hidden by <= 1 check)
- Reset h1 counter when fetching new markdown content

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
  and text selection toolbar (#416)

* feat(chat): add page actions dropdown and text selection
  toolbar (#386)

Add AI chat integration buttons to doc and API pages:
- PageActionsDropdown: MoreVertical menu with Ask Babylon AI, ChatGPT,
Claude deep links
- TextSelectionToolbar: floating toolbar on text selection with same
chat options
- Swizzled DocItem/Layout and ApiItem/Layout to inject both components
- ChatWidget listens for babylon-ai-query events to auto-open and
submit

Closes #386

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(css): adjust page actions dropdown positioning for mobile responsiveness

Updated the CSS for the page actions dropdown to change its position from static to relative, ensuring the menu appears correctly below the trigger on mobile devices. This change enhances the user experience by improving the dropdown's visibility and accessibility on smaller screens.

* fix(TextSelectionToolbar): clear hide timeout on mouseup event

Updated the cleanup function in the useEffect hook to clear the hide timeout reference when the mouseup event listener is removed. This change prevents potential memory leaks and ensures that the toolbar behaves correctly when the user interacts with the text selection.

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Kevin Liu <337459676@qq.com>
@web3jenks web3jenks changed the base branch from dev to main February 18, 2026 05:04
@web3jenks web3jenks requested a review from kkkk666 February 24, 2026 05:24
@web3jenks web3jenks marked this pull request as ready for review February 26, 2026 06:20
@chatgpt-codex-connector
Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Feb 26, 2026

🔐 Commit Signature Verification

All 8 commit(s) passed verification

Commit Author Signature Key Type Key Check
87bbae9b700f Jenks sk-ssh-ed25519
5fb7f5c69979 Jenks sk-ssh-ed25519
d1ab13c75a09 Jenks sk-ssh-ed25519
09e1ea46e759 Jenks sk-ssh-ed25519
4898b8c1ac1d Jenks sk-ssh-ed25519
07ac491d421a Jenks sk-ssh-ed25519
327315200212 Jenks sk-ssh-ed25519
87e228bbc90e Jenks sk-ssh-ed25519

Summary

  • Commits verified: 8
  • Signature check: ✅ All passed
  • Key type enforcement: ✅ All sk-ssh-ed25519

Required key type: sk-ssh-ed25519 (FIDO2 hardware key)

Last verified: 2026-03-23 12:00 UTC

@kkkk666
Copy link
Copy Markdown
Contributor

kkkk666 commented Feb 26, 2026

I tested the anchor links feature, and it still has an issue with inaccurate positioning—there’s an offset from the actual anchor point.

@web3jenks web3jenks force-pushed the fix/153-table-display-remotemd branch from c137c6f to 9135f22 Compare March 12, 2026 04:24
web3jenks added a commit that referenced this pull request Mar 20, 2026
- Fix dependency version conflict: pin remark-gfm@3.0.1, rehype-raw@6.1.1,
  rehype-sanitize@5.0.1 to versions compatible with react-markdown@8
  (npm was hoisting incompatible v4/v7/v6 from Docusaurus, causing
  'inTable' crash at runtime)
- Fix heading slug generation: add extractText() to recursively extract
  plain text from React children, preventing [object Object] in IDs
- Fix anchor link overlay: replace full-surface position:absolute overlay
  with inline # icon that doesn't block clicks on heading content
- Fix version change anchor continuity: preserve URL hash fragment when
  switching releases so users land at the same section
- Fix stale releasesLoaded state: reset releases state when rawUrl or
  releaseVersions props change to prevent rendering wrong document
- Fix render-time ref mutation: move counter resets into React.useMemo
  to avoid React anti-pattern under concurrent rendering

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
web3jenks and others added 2 commits March 20, 2026 17:21
Signed-off-by: Jenks <me@jenksguo.com>
- Fix dependency version conflict: pin remark-gfm@3.0.1, rehype-raw@6.1.1,
  rehype-sanitize@5.0.1 to versions compatible with react-markdown@8
  (npm was hoisting incompatible v4/v7/v6 from Docusaurus, causing
  'inTable' crash at runtime)
- Fix heading slug generation: add extractText() to recursively extract
  plain text from React children, preventing [object Object] in IDs
- Fix anchor link overlay: replace full-surface position:absolute overlay
  with inline # icon that doesn't block clicks on heading content
- Fix version change anchor continuity: preserve URL hash fragment when
  switching releases so users land at the same section
- Fix stale releasesLoaded state: reset releases state when rawUrl or
  releaseVersions props change to prevent rendering wrong document
- Fix render-time ref mutation: move counter resets into React.useMemo
  to avoid React anti-pattern under concurrent rendering

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@web3jenks web3jenks force-pushed the fix/153-table-display-remotemd branch from b37b3b9 to 5fb7f5c Compare March 20, 2026 06:22
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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