Skip to content

Commit

Permalink
Merge pull request #23 from /issues/22/allow-line-breaks
Browse files Browse the repository at this point in the history
Allow line breaks in citation commands
  • Loading branch information
yymao committed Mar 16, 2020
2 parents 71bec71 + 90db4aa commit dea8a98
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions adstex.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,16 @@
except ImportError:
from urllib import unquote

__version__ = "0.3.7"
__version__ = "0.3.8"

_this_year = date.today().year % 100
_this_cent = date.today().year // 100

_re_comment = re.compile(r"(?<!\\)%.*(?=[\r\n])")
_re_bib = re.compile(r"\\(?:no)?bibliography{([\w\s/&.:,-]+)}")
_re_bib = re.compile(r"\\(?:no)?bibliography\*?(?:(?!\n{2,})\s)*{((?:(?!\n{2,})[^{}])+)}")
_re_cite = re.compile(
r"\\(?:bibentry|[cC]ite[a-z]{0,7})\*?(?:\[.*?\])*{([\w\s/&.:,-]+)}"
r"\\(?:bibentry|[cC]ite[a-z]{0,7})\*?(?:(?!\n{2,})\s)*(?:(?<!\\)\[(?:(?!\n{2,}).)*?(?<!\\)\](?:(?!\n{2,})\s)*)*{((?:(?!\n{2,})[^{}])+)}",
re.S,
)
_re_fayear = re.compile(r"([A-Za-z-]+)(?:(?=[\W_])[^\s\d,]+)?((?:\d{2})?\d{2})")
_re_id = {}
Expand Down

0 comments on commit dea8a98

Please sign in to comment.