Commit 580c41db authored by User expired's avatar User expired
Browse files

bib-format: Fix special case of double curly braces

parent ce9cc461
......@@ -109,8 +109,12 @@ do
sed -i 's/ *\(},\?\)$/\1/' "$tmpfile"
sed -i -r '/\{ /s/^( [A-Za-z]+ = \{) +/\1/' "$tmpfile"
# Remove double curly brackets around fields.
sed -i -r '/\{\{/s/^( [A-Za-z]+ = *\{)\{(.*)\}(\}[^}]*)$/\1\2\3/' "$tmpfile"
# Remove double curly brackets around fields (but not "{{...} ... {...}}").
sed -i -r '/\{\{/{
/^ [A-Za-z]+ = *\{\{([^{}]*)(\{[^{}]*\}[^{}]*)*\}\}[^}]*$/{
s/^( [A-Za-z]+ = *\{)\{(.*)\}(\}[^}]*)$/\1\2\3/
}
}' "$tmpfile"
# Append single blank line.
sed -i '$G' "$tmpfile"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment