File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -940,8 +940,8 @@ def _find_smart_matches(section):
940940 section_words = re .split (r'\s+' , sanitized )
941941 # ' ' and '/' are the separators used by known sections
942942 section_pattern = r'[ /]' .join (map (re .escape , section_words ))
943-
944943 section_pattern = re .compile (section_pattern , re .I )
944+
945945 for section_name in sections :
946946 # try to use the input as the pattern to match against known names
947947 if section_pattern .match (section_name ):
@@ -958,14 +958,12 @@ def _find_smart_matches(section):
958958 # try to use the input as the prefix of a flattened section name
959959 normalized_prefix = '' .join (section_words ).lower ()
960960 for section_name , normalized in _section_names_lower_nosep .items ():
961- if (
962- len (normalized_prefix ) <= len (normalized ) and
963- normalized .startswith (normalized_prefix )
964- ):
961+ if normalized .startswith (normalized_prefix ):
965962 matches .append (section_name )
966963
967964 return matches
968965
966+
969967def _extract_section_name (section ):
970968 if section is None :
971969 return None
You can’t perform that action at this time.
0 commit comments