bib2html.py: Add more LaTeX syntax replacement
authorStefan Huber <shuber@sthu.org>
Sat, 29 Jul 2023 17:51:50 +0000 (19:51 +0200)
committerStefan Huber <shuber@sthu.org>
Sat, 29 Jul 2023 17:51:50 +0000 (19:51 +0200)
bib2html.py

index 5db0d075d32d4ba6b75cbe1ddc7ba66a51cc822c..f501b85d67fd9740200882696d43dfd9454c4f76 100755 (executable)
@@ -37,7 +37,7 @@ import os, sys, getopt, re
 def format_latex(text):
     # Get rid of matching dollar signs
     text = re.sub(r'\$([^\$]*)\$', r'\1', text)
-    return text.replace('\mathcal', '').replace('{', '').replace('}', '').replace('\\', '')
+    return text.replace('\mathcal', '').replace('{', '').replace('}', '').replace('\\', '').replace('~', ' ').replace('--', '–')
 
 def format_field_span(type, value):
     return "<span class=bibentry_" + type + ">" + format_latex(value) + "</span>"