fix: pipe symbol markdown table rendering on terminal docs#161
fix: pipe symbol markdown table rendering on terminal docs#161sultanfariz wants to merge 1 commit into
Conversation
📝 WalkthroughWalkthroughThis PR makes two minor rendering adjustments to the Terminal & Shell documentation file. The main heading gains a leading invisible character, and the pipe operator symbol in a reference table changes from escaped text notation to an HTML entity rendering. ChangesDocumentation Rendering Fixes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@phases/00-setup-and-tooling/10-terminal-and-shell/docs/en.md`:
- Line 104: The pipe symbol representation is inconsistent: one table cell uses
the HTML entity &`#124`; (rendered as <code>&`#124`;</code>) while another uses a
backticked escaped pipe ```\|``; update the Key Terms table entry that currently
shows ```\|``` to use the same HTML entity approach (replace the backticked
escaped pipe with the HTML entity representation) so both table cells use
<code>&`#124`;</code>, or if you prefer the backtick style, change the cell that
uses &`#124`; to the backticked ```\|``` form—whichever you choose, make both
occurrences for the pipe operator (the cell showing the symbol and the
description "Send stdout of one command as stdin to the next") consistent.
- Line 104: The table cell currently uses an HTML entity inside a code tag
("&`#124`;") which the lesson renderer escapes; update the table row so the cell
contains an inline-code rendered box-drawing vertical bar character (U+2502)
instead of the entity — i.e. replace the <code>&`#124`;</code> cell with an
inline-code cell containing the glyph "│" so it displays as a styled pipe in the
rendered table.
- Line 1: Remove the invisible BOM/U+FEFF at the start of the "Terminal & Shell"
heading so the line begins with a literal "#" character; the renderer's heading
matcher (/^# (.+)/) requires the "#" to be the first character, so open the file
containing the "Terminal & Shell" H1 and delete the leading invisible character
(or re-save the file without a BOM/UTF-8-BOM) so the line matches the /^# (.+)/
regex and the TOC/header rendering works correctly.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 69deebf5-a2c8-4293-af4a-f3259c39a77c
📒 Files selected for processing (1)
phases/00-setup-and-tooling/10-terminal-and-shell/docs/en.md
| @@ -1,4 +1,4 @@ | |||
| # Terminal & Shell | |||
| # Terminal & Shell | |||
There was a problem hiding this comment.
Critical: Leading invisible character breaks heading rendering.
The line starts with an invisible character (appears to be a BOM/U+FEFF) before the # marker. Based on the renderer in site/lesson.html:2240, the heading regex /^# (.+)/ expects the line to start with #. This leading character will prevent the pattern from matching, breaking H1 rendering and TOC generation entirely.
🔧 Proposed fix
-# Terminal & Shell
+# Terminal & ShellAs per coding guidelines, the renderer matches headings with /^# (.+)/ (site/lesson.html:2240), requiring # at line start.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| # Terminal & Shell | |
| # Terminal & Shell |
🧰 Tools
🪛 LanguageTool
[grammar] ~1-~1: Ensure spelling is correct
Context: # Terminal & Shell > The terminal is where AI engineers live...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@phases/00-setup-and-tooling/10-terminal-and-shell/docs/en.md` at line 1,
Remove the invisible BOM/U+FEFF at the start of the "Terminal & Shell" heading
so the line begins with a literal "#" character; the renderer's heading matcher
(/^# (.+)/) requires the "#" to be the first character, so open the file
containing the "Terminal & Shell" H1 and delete the leading invisible character
(or re-save the file without a BOM/UTF-8-BOM) so the line matches the /^# (.+)/
regex and the TOC/header rendering works correctly.
| | `2>` | Write stderr to file | | ||
| | `2>&1` | Send stderr to same place as stdout | | ||
| | `\|` | Send stdout of one command as stdin to the next | | ||
| | <code>|</code> | Send stdout of one command as stdin to the next | |
There was a problem hiding this comment.
🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win
Ensure consistency with pipe symbol representation in line 341.
Line 341 in the Key Terms table also shows the pipe operator as `\|` within a table cell. If the HTML entity approach at line 104 is confirmed to work correctly, line 341 should be updated to match for consistency. If the approach doesn't work, both locations need the same fix.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@phases/00-setup-and-tooling/10-terminal-and-shell/docs/en.md` at line 104,
The pipe symbol representation is inconsistent: one table cell uses the HTML
entity &`#124`; (rendered as <code>&`#124`;</code>) while another uses a backticked
escaped pipe ```\|``; update the Key Terms table entry that currently shows
```\|``` to use the same HTML entity approach (replace the backticked escaped
pipe with the HTML entity representation) so both table cells use
<code>&`#124`;</code>, or if you prefer the backtick style, change the cell that
uses &`#124`; to the backticked ```\|``` form—whichever you choose, make both
occurrences for the pipe operator (the cell showing the symbol and the
description "Send stdout of one command as stdin to the next") consistent.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Description: Extract and examine the table rendering logic and test the pipe symbol cell
echo "=== Checking inline formatter escape order ==="
rg -A 15 'function inlineFormat' site/lesson.html
echo -e "\n=== Checking table cell processing ==="
rg -B 5 -A 10 'cells.*split.*\|' site/lesson.html
echo -e "\n=== Looking for any special HTML passthrough logic ==="
rg -C 3 'innerHTML|dangerouslySet|raw.*html' site/lesson.htmlRepository: rohitg00/ai-engineering-from-scratch
Length of output: 8118
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "=== Locate table rendering function and where inlineFormat is applied ==="
rg -n "function flushTable|flushTable\\(" site/lesson.html
echo -e "\n=== Show flushTable implementation ==="
rg -n "function flushTable\\b" -n site/lesson.html --context 8
echo -e "\n=== Find where table cells are passed through inlineFormat ==="
rg -n "inlineFormat\\(.*\\bcell|inlineFormat\\(.*\\bc\\b|inlineFormat\\(c\\b|inlineFormat\\(\\w+\\)" site/lesson.html | head -n 50
echo -e "\n=== Inspect parseMd / parseMd pipeline around table handling ==="
rg -n "function parseMd\\b|parseMd\\(" site/lesson.html
rg -n "inTable|tableRows" site/lesson.html --context 3Repository: rohitg00/ai-engineering-from-scratch
Length of output: 3490
🏁 Script executed:
#!/bin/bash
set -euo pipefail
sed -n '95,112p' phases/00-setup-and-tooling/10-terminal-and-shell/docs/en.md | cat -nRepository: rohitg00/ai-engineering-from-scratch
Length of output: 720
Fix rendering of the pipe symbol in the redirect table.
<code>|</code> won’t render as a styled | because the lesson markdown renderer escapes HTML/entities in inlineFormat() before inserting table cell HTML; the entity/tag is therefore output as literal text. Replace the cell with a non-entity glyph, e.g. `│`.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@phases/00-setup-and-tooling/10-terminal-and-shell/docs/en.md` at line 104,
The table cell currently uses an HTML entity inside a code tag ("&`#124`;") which
the lesson renderer escapes; update the table row so the cell contains an
inline-code rendered box-drawing vertical bar character (U+2502) instead of the
entity — i.e. replace the <code>&`#124`;</code> cell with an inline-code cell
containing the glyph "│" so it displays as a styled pipe in the rendered table.
Line 104 uses
\|which breaks table rendering — pipe conflicts with table cell delimiter. Replace with<code>|</code>for correct rendering.