Skip to content

Commit 2e2461e

Browse files
committed
encode: add exclamation mark as unreserved character
Exclamation marks have no special meaning in TeX and thus need to be in this regex (or we should start blacklisting instead of whitelisting).
1 parent 0c49764 commit 2e2461e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/TeX/Encode.pm

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ sub encode
7777
}
7878

7979
# basic unreserved characters
80-
/\G([\sa-zA-Z0-9\.,:;'"\(\)=\-\/\[\]\*\+]+)/gc and ($tex .= $1, next);
80+
/\G([\sa-zA-Z0-9\.,:;'"\(\)=\-\/\[\]\*\+!]+)/gc and ($tex .= $1, next);
8181

8282
# unsupported code point (may set $bad_cp)
8383
/\G(.)/gc and ($tex .= &$check(ord($1)), next);

lib/TeX/Encode/BibTeX.pm

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ sub encode
3434
/\G($TeX::Encode::charmap::CHAR_MAP_RE)/gc and ($tex .= '{'.$TeX::Encode::charmap::CHAR_MAP{$1}.'}', next);
3535

3636
# basic unreserved characters
37-
/\G([\sa-zA-Z0-9\.,:;'"\(\)=\-\/\[\]\*\+]+)/gc and ($tex .= $1, next);
37+
/\G([\sa-zA-Z0-9\.,:;'"\(\)=\-\/\[\]\*\+!]+)/gc and ($tex .= $1, next);
3838
/\G([\x00-\x7e])/gc and ($tex .= $1, next);
3939

4040
/\G(.)/gc and ($tex .= '?', next);

0 commit comments

Comments
 (0)