fix(docs): escape example Blade expression in mobile v4 Text doc#424
Merged
Conversation
The "Dynamic content" aside contained an inline `{{ $variable }}` in prose
that was neither wrapped in @verbatim nor escaped. Doc .md files render through
the Blade engine before markdown conversion, so Blade evaluated it and threw
"Undefined variable $variable", 500ing the page. Escape it with @{{ }} (the
convention already used elsewhere) so the literal renders.
Adds a regression test plus a guard that renders every docs page as Blade to
catch any other unescaped example expressions.
Fixes #72
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Summary
The mobile v4
Textedge-component doc page (/docs/mobile/4/edge-components/text) was returning a 500 in production withErrorException: Undefined variable $variable.Documentation
.mdfiles are rendered through the Blade engine before markdown conversion (ShowDocumentationController::getMarkdownViewmaps.md→ thebladeengine). The "Dynamic content"<aside>contained an inline example in prose:That
{{ $variable }}was neither wrapped in@verbatimnor escaped, so Blade evaluated it as a real variable and threw. (Markdown backticks don't help — Blade runs first. The nearby{{ $score }}example was fine because it lives inside a@verbatimblock.)Fix
Escape the inline expression with
@{{ }}— the same convention already used elsewhere in the docs (e.g.super-native/reactivity.md). Blade now emits the literal{{ $variable }}, so the reader still sees the intended text and the page renders.Tests
tests/Feature/DocumentationRenderingTest.php:GET /docs/mobile/4/edge-components/textreturns200and shows the literal{{ $variable }}.Both tests fail on the un-fixed doc (reproducing the exact
Undefined variable $variable500) and pass with the fix. Pint is clean.Fixes #72