Skip to content

Detect extra spaces in old-style keywords like ref and caption#859

Merged
chrismaddalena merged 4 commits intomasterfrom
hotfix/detect-spaces
Apr 8, 2026
Merged

Detect extra spaces in old-style keywords like ref and caption#859
chrismaddalena merged 4 commits intomasterfrom
hotfix/detect-spaces

Conversation

@chrismaddalena
Copy link
Copy Markdown
Collaborator

Detect extra spaces in old-style keywords—like .caption and .ref—to avoid syntax errors.

Copilot AI review requested due to automatic review settings April 7, 2026 19:38
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates Ghostwriter’s rich text → Jinja preprocessing to tolerate whitespace in legacy “dot syntax” tags (e.g., {{ .ref ... }}), preventing template syntax issues when users (or editors) insert extra spaces.

Changes:

  • Broadened the legacy dot-syntax replacement regex to accept optional whitespace around the .keyword token.
  • Added unit coverage to confirm spaced legacy .ref tags render correctly.
  • Added an integration-style regression test ensuring DOCX export succeeds when a Report rich text extra field contains a spaced legacy .ref tag.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
ghostwriter/modules/reportwriter/base/html_rich_text.py Adjusts legacy dot-syntax parsing to accept whitespace inside {{ ... }}.
ghostwriter/reporting/tests/test_rich_text_templating.py Adds tests covering spaced legacy .ref parsing and a DOCX export regression path.

Comment thread ghostwriter/modules/reportwriter/base/html_rich_text.py
Comment thread ghostwriter/reporting/tests/test_rich_text_templating.py Outdated
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.77%. Comparing base (bfcc916) to head (123c679).
⚠️ Report is 5 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #859   +/-   ##
=======================================
  Coverage   91.76%   91.77%           
=======================================
  Files         376      376           
  Lines       21943    21958   +15     
=======================================
+ Hits        20137    20151   +14     
- Misses       1806     1807    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

Comment thread ghostwriter/modules/reportwriter/base/html_rich_text.py Outdated
Comment thread ghostwriter/reporting/tests/test_rich_text_templating.py
@chrismaddalena chrismaddalena merged commit 2c8d97f into master Apr 8, 2026
9 checks passed
@chrismaddalena chrismaddalena deleted the hotfix/detect-spaces branch April 8, 2026 00:10
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.

2 participants