Created
March 9, 2019 09:35
-
-
Save v0y4g3r/a3e2dfc7fa14a90b844f911600a8a3d8 to your computer and use it in GitHub Desktop.
gogs使用latex公式无法使用下标(与emphasis混淆)
This file contains 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
#! /bin/bash | |
# set -x | |
cgd="$(git diff --cached --name-status | awk '$1 != "D" {print $2} '| tr -d '\r'| tr '\n' ' ')" | |
# echo "${cgd}" | |
for f in "${cgd[@]}";do | |
perl -i -ne 's/(?<!\\)_\{/\\_\{/g; print;' $f | |
backup_file="$(echo "$f" | sed 's/[[:space:]]*$//')".bak | |
# echo "${backup_file}" | |
if [ -f "${backup_file}" ]; then | |
rm "${backup_file}" | |
fi | |
done | |
git add --all | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment