mirror of https://github.com/tiangolo/fastapi.git
Fix comment regexes (require leading whitespace if comment starts not at the line start)
This commit is contained in:
parent
e7fb2453ea
commit
b3ad074153
|
|
@ -26,8 +26,11 @@ HTML_ATTR_RE = re.compile(r'(\w+)\s*=\s*([\'"])(.*?)\2')
|
|||
|
||||
CODE_BLOCK_LANG_RE = re.compile(r"^```([\w-]*)", re.MULTILINE)
|
||||
|
||||
SLASHES_COMMENT_RE = re.compile(r"^(?P<code>.*?)(?P<comment>\s*// .*)?$")
|
||||
HASH_COMMENT_RE = re.compile(r"^(?P<code>.*?)(?P<comment>\s*# .*)?$")
|
||||
SLASHES_COMMENT_RE = re.compile(
|
||||
r"^(?P<code>.*?)(?P<comment>(?:(?<= )// .*)|(?:^// .*))?$"
|
||||
)
|
||||
|
||||
HASH_COMMENT_RE = re.compile(r"^(?P<code>.*?)(?P<comment>(?:(?<= )# .*)|(?:^# .*))?$")
|
||||
|
||||
|
||||
class CodeIncludeInfo(TypedDict):
|
||||
|
|
|
|||
Loading…
Reference in New Issue