4343_wl_to_ascii = _data .get ("wl-to-ascii-dict" , {})
4444_wl_to_ascii_re = re .compile (_data .get ("wl-to-ascii-re" , "" ))
4545
46+ # AMS LaTeX replacements
47+ _wl_to_amstex = _data .get ("wl-to-amstex" , None )
48+
4649# Conversion from WL to unicode
47- _wl_to_unicode = _data .get ("wl-to-unicode-dict" , {} )
50+ _wl_to_unicode = _data .get ("wl-to-unicode-dict" , _data . get ( "wl_to_ascii" ) )
4851_wl_to_unicode_re = re .compile (_data .get ("wl-to-unicode-re" , "" ))
4952
5053# Conversion from unicode to WL
5861aliased_characters = _data .get ("aliased-characters" , {})
5962
6063
64+ # Deprecated
6165def replace_wl_with_plain_text (wl_input : str , use_unicode = True ) -> str :
6266 """
6367 The Wolfram Language uses specific Unicode characters to represent Wolfram
@@ -78,9 +82,12 @@ def replace_wl_with_plain_text(wl_input: str, use_unicode=True) -> str:
7882 r = _wl_to_unicode_re if use_unicode else _wl_to_ascii_re
7983 d = _wl_to_unicode if use_unicode else _wl_to_ascii
8084
81- return r .sub (lambda m : d [m .group (0 )], wl_input )
85+ # The below on when use_unicode is False will sometime test on "ascii" twice.
86+ # But this routine should be deprecated.
87+ return r .sub (lambda m : d .get (m .group (0 ), _wl_to_ascii .get (m .group (0 ))), wl_input )
8288
8389
90+ # Deprecated
8491def replace_unicode_with_wl (unicode_input : str ) -> str :
8592 """
8693 The Wolfram Language uses specific Unicode characters to represent Wolfram
0 commit comments