bugdown: Rename VerbosePattern to CompiledPattern.

This class only requires a compiled regex--it's up
to the callers how they compile it (verbose or
otherwise).
This commit is contained in:
Steve Howell
2019-01-22 18:08:33 +00:00
committed by Tim Abbott
parent 681f07f98f
commit 025df33d7a

View File

@@ -1272,7 +1272,7 @@ def url_to_a(db_data: Optional[DbData], url: str, text: Optional[str]=None) -> U
fixup_link(a, target_blank)
return a
class VerbosePattern(markdown.inlinepatterns.Pattern):
class CompiledPattern(markdown.inlinepatterns.Pattern):
def __init__(self, compiled_re: Pattern, md: markdown.Markdown) -> None:
markdown.inlinepatterns.Pattern.__init__(self, ' ', md)
@@ -1281,7 +1281,7 @@ class VerbosePattern(markdown.inlinepatterns.Pattern):
self.compiled_re = compiled_re
class AutoLink(VerbosePattern):
class AutoLink(CompiledPattern):
def handleMatch(self, match: Match[str]) -> ElementStringNone:
url = match.group('url')
db_data = self.markdown.zulip_db_data
@@ -1566,7 +1566,7 @@ class UserGroupMentionPattern(markdown.inlinepatterns.Pattern):
return el
return None
class StreamPattern(VerbosePattern):
class StreamPattern(CompiledPattern):
def find_stream_by_name(self, name: Match[str]) -> Optional[Dict[str, Any]]:
db_data = self.markdown.zulip_db_data
if db_data is None: