Skip to content

Commit

Permalink
Fix checking DOI in URL
Browse files Browse the repository at this point in the history
  • Loading branch information
zepinglee committed May 15, 2024
1 parent c8c15e6 commit 59aa8ed
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 15 deletions.
13 changes: 8 additions & 5 deletions thuthesis-author-year.bst
Original file line number Diff line number Diff line change
Expand Up @@ -1499,7 +1499,7 @@ FUNCTION {format.periodical.year.volume.number}

FUNCTION {check.url}
{ url empty$ not
{ "\url{" url * "}" * 'entry.url :=
{ url 'entry.url :=
#1 'entry.is.electronic :=
}
{ howpublished empty$ not
Expand Down Expand Up @@ -1530,7 +1530,11 @@ FUNCTION {output.url}
{ show.url is.pure.electronic or
entry.url empty$ not and
{ new.block
entry.url output
entry.url #1 #4 substring$ "\url{" =
{ entry.url }
{ "\url{" entry.url * "}" * }
if$
output
}
'skip$
if$
Expand All @@ -1549,10 +1553,9 @@ FUNCTION {is.in.url}
{ #1 }
{ entry.url empty$
{ #0 }
{ s "l" change.case$ 's :=
s text.length$ 'len :=
{ s text.length$ 'len :=
entry.url "l" change.case$ text.length$ 'charptr :=
{ entry.url "l" change.case$ charptr len substring$ s = not
{ entry.url "l" change.case$ charptr len substring$ s "l" change.case$ = not
charptr #0 >
and
}
Expand Down
13 changes: 8 additions & 5 deletions thuthesis-bachelor.bst
Original file line number Diff line number Diff line change
Expand Up @@ -1489,7 +1489,7 @@ FUNCTION {format.periodical.year.volume.number}

FUNCTION {check.url}
{ url empty$ not
{ "\url{" url * "}" * 'entry.url :=
{ url 'entry.url :=
#1 'entry.is.electronic :=
}
{ howpublished empty$ not
Expand Down Expand Up @@ -1520,7 +1520,11 @@ FUNCTION {output.url}
{ show.url is.pure.electronic or
entry.url empty$ not and
{ new.block
entry.url output
entry.url #1 #4 substring$ "\url{" =
{ entry.url }
{ "\url{" entry.url * "}" * }
if$
output
}
'skip$
if$
Expand All @@ -1539,10 +1543,9 @@ FUNCTION {is.in.url}
{ #1 }
{ entry.url empty$
{ #0 }
{ s "l" change.case$ 's :=
s text.length$ 'len :=
{ s text.length$ 'len :=
entry.url "l" change.case$ text.length$ 'charptr :=
{ entry.url "l" change.case$ charptr len substring$ s = not
{ entry.url "l" change.case$ charptr len substring$ s "l" change.case$ = not
charptr #0 >
and
}
Expand Down
13 changes: 8 additions & 5 deletions thuthesis-numeric.bst
Original file line number Diff line number Diff line change
Expand Up @@ -1489,7 +1489,7 @@ FUNCTION {format.periodical.year.volume.number}

FUNCTION {check.url}
{ url empty$ not
{ "\url{" url * "}" * 'entry.url :=
{ url 'entry.url :=
#1 'entry.is.electronic :=
}
{ howpublished empty$ not
Expand Down Expand Up @@ -1520,7 +1520,11 @@ FUNCTION {output.url}
{ show.url is.pure.electronic or
entry.url empty$ not and
{ new.block
entry.url output
entry.url #1 #4 substring$ "\url{" =
{ entry.url }
{ "\url{" entry.url * "}" * }
if$
output
}
'skip$
if$
Expand All @@ -1539,10 +1543,9 @@ FUNCTION {is.in.url}
{ #1 }
{ entry.url empty$
{ #0 }
{ s "l" change.case$ 's :=
s text.length$ 'len :=
{ s text.length$ 'len :=
entry.url "l" change.case$ text.length$ 'charptr :=
{ entry.url "l" change.case$ charptr len substring$ s = not
{ entry.url "l" change.case$ charptr len substring$ s "l" change.case$ = not
charptr #0 >
and
}
Expand Down

0 comments on commit 59aa8ed

Please sign in to comment.