Skip to content

check_formalities: escape LaTeX special characters in output#13

Merged
GeorgeSapkin merged 1 commit intoGeorgeSapkin:mainfrom
BKPepe:fix/latex-escaping
Jan 14, 2026
Merged

check_formalities: escape LaTeX special characters in output#13
GeorgeSapkin merged 1 commit intoGeorgeSapkin:mainfrom
BKPepe:fix/latex-escaping

Conversation

@BKPepe
Copy link
Contributor

@BKPepe BKPepe commented Jan 11, 2026

The script currently inserts substrings of the commit subject and body directly into LaTeX-formatted strings for GitHub Actions output. If these substrings contain special LaTeX characters (such as underscore '_'), it causes the LaTeX rendering to fail in the CI output.

This commit introduces a helper function 'escape_latex' in 'src/helpers.sh'
which escapes common LaTeX special characters
('', '_', '$', '&', '%', '#', '{', '}').

The 'check_formalities.sh' script is updated to use this function when preparing the failure output, ensuring that the generated LaTeX is valid regardless of the commit content.

Fixes: #12 (comment)

Copilot AI review requested due to automatic review settings January 11, 2026 18:17
@github-actions

This comment has been minimized.

Copy link

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

This PR fixes LaTeX rendering failures in GitHub Actions output by escaping special characters in commit messages. The issue occurred when commit subjects or bodies contained LaTeX special characters (like underscores), causing the CI output rendering to fail.

Changes:

  • Added escape_latex helper function to escape common LaTeX special characters
  • Updated output_split_fail and output_split_fail_ex functions to apply escaping before generating LaTeX output

Reviewed changes

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

File Description
src/helpers.sh Introduces new escape_latex function to escape LaTeX special characters (backslash, underscore, dollar, ampersand, percent, hash, braces)
src/check_formalities.sh Updates output functions to escape commit text before inserting into LaTeX-formatted GitHub Actions output

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@BKPepe
Copy link
Contributor Author

BKPepe commented Jan 12, 2026

Always fun with Copilot.

@BKPepe BKPepe force-pushed the fix/latex-escaping branch from 0e1b202 to bb5e6ed Compare January 12, 2026 08:40
@github-actions

This comment has been minimized.

@BKPepe BKPepe force-pushed the fix/latex-escaping branch from bb5e6ed to f87922b Compare January 12, 2026 08:48
@github-actions

This comment has been minimized.

@BKPepe BKPepe force-pushed the fix/latex-escaping branch from f87922b to c04d209 Compare January 12, 2026 09:36
@github-actions

This comment has been minimized.

@BKPepe BKPepe force-pushed the fix/latex-escaping branch from c04d209 to 4fa40bb Compare January 12, 2026 10:12
@github-actions

This comment has been minimized.

@BKPepe BKPepe force-pushed the fix/latex-escaping branch from 4fa40bb to 0b61f24 Compare January 12, 2026 10:24
@github-actions

This comment has been minimized.

@BKPepe BKPepe force-pushed the fix/latex-escaping branch from 0b61f24 to d68955d Compare January 12, 2026 10:24
@github-actions

This comment has been minimized.

The script currently inserts substrings of the commit subject and body
directly into LaTeX-formatted strings for GitHub Actions output. If
these substrings contain special LaTeX characters (such as underscore
'_'), it causes the LaTeX rendering to fail in the CI output.

This commit introduces a helper function 'escape_latex' in
'src/helpers.sh' which escapes common LaTeX special characters ('\',
'_', '$', '&', '%', '#', '{', '}').

The 'check_formalities.sh' script is updated to use this function when
preparing the failure output, ensuring that the generated LaTeX is valid
regardless of the commit content.

Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
@GeorgeSapkin GeorgeSapkin merged commit 2d1b2b1 into GeorgeSapkin:main Jan 14, 2026
2 checks passed
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.

3 participants