Skip to content

fix(site): repair lesson table rendering#231

Open
Bansnetsajak007 wants to merge 1 commit into
rohitg00:mainfrom
Bansnetsajak007:tablefix-issue-193
Open

fix(site): repair lesson table rendering#231
Bansnetsajak007 wants to merge 1 commit into
rohitg00:mainfrom
Bansnetsajak007:tablefix-issue-193

Conversation

@Bansnetsajak007
Copy link
Copy Markdown

What this PR does

Fixes lesson table rendering when markdown table cells contain escaped pipes like P(X\|Y) or pipes inside inline code spans.

This resolves the broken table layout reported in #193 for the Naive Bayes lesson and applies the fix to the shared lesson renderer so similar tables across the curriculum render
correctly.

Kind of change

  • Docs / website / tooling

Details

  • Parses markdown table rows without splitting on escaped \| pipes
  • Preserves pipe characters inside inline code spans
  • Normalizes table rows to the header column count to prevent layout-breaking extra columns
  • Updates lesson table CSS so wide tables scroll horizontally instead of compressing into unreadable columns

Validation

  • Verified locally on phases/02-ml-fundamentals/14-naive-bayes
  • python3 scripts/audit_lessons.py
  • python3 scripts/check_readme_counts.py
  • git diff --check

Fixes #193

Copilot AI review requested due to automatic review settings May 29, 2026 02:40
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 29, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: d854ac38-53d2-4dea-aa11-026af68c1726

📥 Commits

Reviewing files that changed from the base of the PR and between 86bbb61 and 7fd1f4b.

📒 Files selected for processing (1)
  • site/lesson.html

📝 Walkthrough

Walkthrough

CSS styling improvements and markdown table parser robustness updates fix table rendering issues. Table containers now enable touch-friendly scrolling with auto layout and explicit min-widths; cells disable hyphenation and refine text wrapping. A new markdown parser uses helper functions to correctly split pipe-delimited rows while respecting escaped pipes and inline code, then normalizes rows to the header column count.

Changes

Table Rendering Fix

Layer / File(s) Summary
Table Styling and Responsive Layout
site/lesson.html
Table containers enable touch-friendly overflow scrolling, layout shifts from fixed/block to auto with min-width constraints, cell hyphenation is disabled, text wrapping is refined, and small-screen media queries adjust font size and padding.
Markdown Table Parser Robustness
site/lesson.html
New splitTableRow helper parses pipe-delimited rows while handling escaped | and inline code backticks; normalizeTableCells pads or merges cells to match header column count; markdown parsing loop integrates the new splitter instead of naive split.

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix(site): repair lesson table rendering' directly and specifically describes the main change in the changeset, which focuses on fixing lesson table rendering issues.
Description check ✅ Passed The description clearly explains what the PR does (fixes lesson table rendering for escaped pipes and inline code), the changes made, and validation performed, all directly related to the changeset.
Linked Issues check ✅ Passed The PR addresses issue #193 by implementing robust table row parsing that handles escaped pipes and inline code, and applies CSS updates for horizontal scrolling—all coding requirements needed to resolve the broken table rendering.
Out of Scope Changes check ✅ Passed All changes are scoped to fixing lesson table rendering: CSS styling updates for table layout and horizontal scrolling, and markdown parser enhancements for proper pipe handling—all directly address the stated objectives.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

[bug] Tables messed up

1 participant