File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -273,20 +273,26 @@ def get_abstract(self):
273273 if self ._abstract :
274274 return self ._abstract
275275 abstract_re = re .compile ('^(\s*)abstract' , re .I )
276- header_re = re .compile ("^(\s*)(1\.|A\. |Appendix|Status of|Table of|Full Copyright|Copyright|Intellectual Property|Acknowled|Author|Index).*" , re .I )
276+ header_re = re .compile ("^(\s*)([0-9]+\.? |Appendix|Status of|Table of|Full Copyright|Copyright|Intellectual Property|Acknowled|Author|Index).*" , re .I )
277277 begin = False
278278 abstract = []
279279 abstract_indent = 0
280+ look_for_header = False
280281 for line in self .lines :
281282 if not begin and abstract_re .match (line ):
282283 begin = True
283284 abstract_indent = len (abstract_re .match (line ).group (0 ))
284285 continue
285286 if begin :
286- if header_re .match (line ):
287- break
288287 if not line and not abstract :
289288 continue
289+ if not line :
290+ look_for_header = True
291+ abstract .append (line )
292+ continue
293+ if look_for_header and header_re .match (line ):
294+ break
295+ look_for_header = False
290296 abstract .append (line )
291297 abstract = '\n ' .join (abstract )
292298 abstract = self ._clean_abstract (abstract )
You can’t perform that action at this time.
0 commit comments