Skip to content

Fix broken URL in morgan.mdx custom format example - #2515

Open
brmendez wants to merge 3 commits into
expressjs:mainfrom
brmendez:fix-morgan-response-time-typo
Open

brmendez wants to merge 3 commits into
expressjs:mainfrom
brmendez:fix-morgan-response-time-typo

Conversation

@brmendez

@brmendez brmendez commented Sep 17, 2026

Copy link
Copy Markdown

Summary

  • Fixed a stray GitHub URL that was accidentally inserted into the tokens['response-time'](req, res) call in the custom format function example, breaking the code sample.
  • Scoped to en only. The same bad URL also exists in the translated copies (ja, it, zh-cn, zh-tw, pt-br, de, ko, fr, es).

Test plan

  • Verified the code block now renders valid JS matching the pattern used elsewhere on the page.

@brmendez
brmendez requested a review from a team as a code owner September 17, 2026 18:45
@netlify

netlify Bot commented Sep 17, 2026

Copy link
Copy Markdown

Deploy Preview for expressjscom-preview ready!

Name Link
🔨 Latest commit aadbb97
🔍 Latest deploy log https://app.netlify.com/projects/expressjscom-preview/deploys/6aac482524422c0008bc952e
😎 Deploy Preview https://deploy-preview-2515--expressjscom-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 96 (🔴 down 1 from production)
Accessibility: 100 (no change from production)
Best Practices: 100 (no change from production)
SEO: 100 (no change from production)
PWA: 80 (no change from production)
View the detailed breakdown and full score reports
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@krzysdz

krzysdz commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

This is a problem with the way how the get-readmes.sh script converts relative GitHub URLs. The script uses simple regular expressions and cannot detect that this is code inside a code block that looks like a link [something](URL).

# Convert relative links to absolute GitHub URLs
BASEURL="https://github.com/$org/$repo/blob/HEAD"
CONTENT=$(echo "$CONTENT" | sed -E "s|\]\(([^)#/][^):]*)\)|](${BASEURL}/\1)|g")

There is a workflow which replaces the content of this file with up-to-date readmes, so manual changes are overwritten. If you have an idea how to fix the script, then go ahead and edit this PR or create a new one.

cc @bjohansebas

@brmendez

Copy link
Copy Markdown
Author

Fixed by skipping fenced code blocks in the link-rewrite regex. Doesn't cover inline single-backtick code spans, but none of the current READMEs use that.

@krzysdz krzysdz added bug docs Issues/pr concerning content github_actions Pull requests that update GitHub Actions code labels Sep 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug docs Issues/pr concerning content github_actions Pull requests that update GitHub Actions code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants