projects
/
shutils.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b19c6ec
)
bib2html.py: Add umlaut replacement
author
Stefan Huber <shuber@sthu.org>
Tue, 1 Aug 2023 07:31:42 +0000
(09:31 +0200)
committer
Stefan Huber <shuber@sthu.org>
Tue, 1 Aug 2023 07:31:42 +0000
(09:31 +0200)
bib2html.py
patch
|
blob
|
history
diff --git
a/bib2html.py
b/bib2html.py
index dee284ec3a1a51239ab019801bed5e9bd772ab90..5d5b4db16f6e75bbd796858d792714130052a614 100755
(executable)
--- a/
bib2html.py
+++ b/
bib2html.py
@@
-37,7
+37,25
@@
import os, sys, getopt, re
def format_latex(text):
# Get rid of matching dollar signs
text = re.sub(r'\$([^\$]*)\$', r'\1', text)
def format_latex(text):
# Get rid of matching dollar signs
text = re.sub(r'\$([^\$]*)\$', r'\1', text)
- return text.replace('\mathcal', '').replace('{', '').replace('}', '').replace('\\', '').replace('~', ' ').replace('--', '–')
+
+ # Replace text
+ subst = {
+ '\\"a': 'ä',
+ '\\"o': 'ö',
+ '\\"u': 'u',
+ '\mathcal': '',
+ '{': '',
+ '}': '',
+ '\\': '',
+ '~': ' ',
+ '---': '–',
+ '--': '–',
+ }
+
+ for a, b in subst.items():
+ text = text.replace(a, b)
+
+ return text
def format_field_span(type, value):
return "<span class=bibentry_" + type + ">" + format_latex(value) + "</span>"
def format_field_span(type, value):
return "<span class=bibentry_" + type + ">" + format_latex(value) + "</span>"