check_formalities: escape LaTeX special characters in output#13
Merged
GeorgeSapkin merged 1 commit intoGeorgeSapkin:mainfrom Jan 14, 2026
Merged
check_formalities: escape LaTeX special characters in output#13GeorgeSapkin merged 1 commit intoGeorgeSapkin:mainfrom
GeorgeSapkin merged 1 commit intoGeorgeSapkin:mainfrom
Conversation
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
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_latexhelper function to escape common LaTeX special characters - Updated
output_split_failandoutput_split_fail_exfunctions 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.
Contributor
Author
|
Always fun with Copilot. |
0e1b202 to
bb5e6ed
Compare
This comment has been minimized.
This comment has been minimized.
bb5e6ed to
f87922b
Compare
This comment has been minimized.
This comment has been minimized.
f87922b to
c04d209
Compare
This comment has been minimized.
This comment has been minimized.
c04d209 to
4fa40bb
Compare
This comment has been minimized.
This comment has been minimized.
4fa40bb to
0b61f24
Compare
This comment has been minimized.
This comment has been minimized.
0b61f24 to
d68955d
Compare
This comment has been minimized.
This comment has been minimized.
d68955d to
c9f8091
Compare
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>
c9f8091 to
81dc90a
Compare
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.
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)