Skip to content

Commit 9d09ced

Browse files
committed
Merged in [19363] from rjsparks@nostrum.com:
Tune text draft reference extractor. Fixes ietf-tools#3404. - Legacy-Id: 19371 Note: SVN reference [19363] has been migrated to Git commit 50a1e6e
2 parents 0d8c0ce + 50a1e6e commit 9d09ced

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

ietf/utils/draft.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636

3737

3838

39+
import debug # pyflakes: ignore
3940

4041
import datetime
4142
import getopt
@@ -1047,6 +1048,10 @@ def get_refs(self):
10471048
# std at the front of a line can hide things like IEEE STD or MIL-STD
10481049
std_start = re.compile( r'(?i)std\n*\b' )
10491050

1051+
not_starting_regexes = [
1052+
re.compile( r'(?i) uri references:?$' ),
1053+
]
1054+
10501055
refs = {}
10511056
in_ref_sect = False
10521057
in_norm_ref_sect = False
@@ -1064,11 +1069,12 @@ def get_refs(self):
10641069
m = sectionre3.match( line )
10651070

10661071
if m:
1067-
in_ref_sect = True
1068-
refType = 'info'
1069-
if line.lower().find("normative") > 1:
1070-
in_norm_ref_sect = True
1071-
refType = 'norm'
1072+
if not any( [ rule.search( line ) for rule in not_starting_regexes ]):
1073+
in_ref_sect = True
1074+
refType = 'info'
1075+
if line.lower().find("normative") > 1:
1076+
in_norm_ref_sect = True
1077+
refType = 'norm'
10721078

10731079
# might be subsections within a references section
10741080
if in_ref_sect and not in_norm_ref_sect:

0 commit comments

Comments
 (0)