Skip to content

Commit

Permalink
Fix DOIs in publication data file (#15)
Browse files Browse the repository at this point in the history
In .bib files the underscores in DOIs are usually escaped ('\_').
When converting biblatex to YAML, pandoc escapes both characters
again.  This results in '\\\_'.  When writing the DOI url, this
is repeated to produced '\\\\\\_'.

I couldn't find a way to turn this of.  Instead this commit extends
the generation python script to remove those superfluous escapes.
  • Loading branch information
hansjoergschurr authored Jan 26, 2024
1 parent 3a815bc commit a250361
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions _scripts/gen_refs_yml.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ def format_note(match):
subst = {
'---\n': '',
'\n---': '',
r'\\\\\\\\\\\\\_': '_', # remove 6 \ before _
r'\\\\\\\_': '_', # remove 3 \ before _
'nocite: \"\[@\*\]\"\n': '',
r'issued: ([0-9][0-9][0-9][0-9])-([0-9][0-9])':\
r'issued:\n - year: \1\n month: \2',
Expand Down

0 comments on commit a250361

Please sign in to comment.