diff options
author | Alejandro Gallo <aamsgallo@gmail.com> | 2018-09-02 20:23:44 +0200 |
---|---|---|
committer | Alejandro Gallo <aamsgallo@gmail.com> | 2018-09-02 20:23:44 +0200 |
commit | 95d5128599ce409ef42f3374ea746ead4ee8c93d (patch) | |
tree | 50a3e50ad87432d47414431e9ea0e445e677c4eb | |
parent | 6e5da4defe4c7245d17fbe5c2cdad9d94090ab0a (diff) |
Do not write weird symbols in references for bibtex
-rw-r--r-- | papis/document.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/papis/document.py b/papis/document.py index 5bc8b8f6..4087fb0d 100644 --- a/papis/document.py +++ b/papis/document.py @@ -4,6 +4,7 @@ import papis.utils import papis.config import papis.bibtex import logging +import re logger = logging.getLogger("document") @@ -120,6 +121,8 @@ def to_bibtex(document): else: ref = 'noreference' + ref = re.sub(r'[;,()\/{}\[\]]', '', ref) + bibtexString += "@%s{%s,\n" % (bibtexType, ref) for bibKey in papis.bibtex.bibtex_keys: if bibKey in document.keys(): |