Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -111,13 +111,14 @@ def create_bibtex_entry(data):
|
|
| 111 |
if year and 'year' not in data:
|
| 112 |
data['year'] = year
|
| 113 |
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
|
|
|
| 121 |
|
| 122 |
#Pages conformity.
|
| 123 |
if 'pages' in data:
|
|
|
|
| 111 |
if year and 'year' not in data:
|
| 112 |
data['year'] = year
|
| 113 |
|
| 114 |
+
if "year" in data:
|
| 115 |
+
match_year = re.search(r'(\d{4})', data['year'])
|
| 116 |
+
|
| 117 |
+
if match_year:
|
| 118 |
+
data['year'] = match_year.group(1)
|
| 119 |
+
year = data['year']
|
| 120 |
+
else:
|
| 121 |
+
data.pop('year', '')
|
| 122 |
|
| 123 |
#Pages conformity.
|
| 124 |
if 'pages' in data:
|