Skip to content

Update link-rewriting regexes - #814

Open
Andriciuc wants to merge 1 commit into
valkey-io:mainfrom
Andriciuc:fix-regex-missing-links
Open

Andriciuc wants to merge 1 commit into
valkey-io:mainfrom
Andriciuc:fix-regex-missing-links

Conversation

@Andriciuc

Copy link
Copy Markdown
Contributor

Description

Tighten the link-rewriting regexes in command.html and docs.html so a match can't run from one link into the next on the same line. .? becomes [^)]? and .md/.png/.gif are escaped.

This fixes the broken FT.SEARCH topic links, and stops the same thing on any future page, just futureproofing.

Issues Resolved

Fixes valkey-io/valkey-doc#570.

Check List

  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the BSD-3-Clause License.

Tighten the link-rewriting regexes in command.html and docs.html so a match can't run from one link into the next on the same line. .*? becomes [^)]*? and .md/.png/.gif are escaped.

This fixes the broken FT.SEARCH topic links reported in valkey-io/valkey-doc#570, and stops the same thing on any future page, just futureproofing.

Signed-off-by: Dragos Andriciuc <andriciucdragos@protonmail.com>
@Andriciuc
Andriciuc requested a review from madolson December 2, 2026 09:51
@Andriciuc Andriciuc self-assigned this Dec 2, 2026
@Andriciuc Andriciuc added the enhancement New feature or request label Dec 2, 2026
@coderabbitai

coderabbitai Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The command and documentation templates now use narrower patterns to rewrite relative topic, command, Markdown, and image links. The patterns exclude closing parentheses from captures and match file extensions literally. Existing rewrite destinations remain unchanged.

Changes: Link Rewriting

Layer / File(s) Summary
Tighten link-matching patterns
templates/macros/command.html, templates/macros/docs.html
The patterns constrain filename and anchor captures, exclude closing parentheses, and match .md, .png, and .gif extensions literally. Rewrite destinations remain unchanged.

Assessment against linked issues

Objective Addressed Explanation
Prevent link-rewriting patterns from matching across links and match file extensions literally [#570] ✅

Possibly related PRs

Severity of issue fixed: Medium

Merge Risk: Minimal · up to 3bc91

This change tightens how relative documentation links are rewritten so a match can no longer run across adjacent links. It is a small, easily reverted template change with no remaining merge risk identified.

- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f2061f39-172b-4024-92fb-f6563c63282a
Commits

Reviewing files that changed from the base of the PR and between b46349f and 3bc91c7.

Files selected for processing: 2

  • templates/macros/command.html
  • templates/macros/docs.html

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@greptile-apps

greptile-apps Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5RetriggerView in Greptile

[Medium impact] The PR appears safe to merge.

Summary

Tightens link rewriting in command and topic pages.

  • Markdown links stay within their own parentheses.

Reviews (1) · Last reviewed commit: "Update link-rewriting regexes" · Reviewed by Greptile

@github-actions

github-actions Bot commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

This branch has not been deployed

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix broken links on ft.search and search-scoring pages

1 participant