File tree Expand file tree Collapse file tree
utils/external_project_parsers/parsers Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -78,4 +78,4 @@ def __post_init__(self):
7878 raise ValueError (
7979 "CheatsheetRecord: metadata keys and values must be strings, "
8080 f"got { key !r} : { value !r} "
81- )
81+ )
Original file line number Diff line number Diff line change 11import os
22import re
3+
34from application .defs .cheatsheet_defs import CheatsheetRecord
45
56PARSER_VERSION = "v1"
67FALLBACK_USED = "false"
8+
79CANONICAL_BASE_URL = "https://cheatsheetseries.owasp.org/cheatsheets/"
810
911_TITLE_RE = re .compile (r"^#\s+(?P<title>.+)$" , re .MULTILINE )
@@ -51,6 +53,7 @@ def _extract_summary(markdown: str) -> str:
5153
5254 if body :
5355 return body
56+
5457 break
5558
5659 for match in all_heading_matches :
@@ -59,7 +62,9 @@ def _extract_summary(markdown: str) -> str:
5962 if body :
6063 return body
6164
62- raise ValueError ("_extract_summary: no summary could be extracted from markdown." )
65+ raise ValueError (
66+ "_extract_summary: no summary could be extracted from markdown."
67+ )
6368
6469
6570def extract_cheatsheet_record (
@@ -90,4 +95,4 @@ def extract_cheatsheet_record(
9095 "parser_version" : PARSER_VERSION ,
9196 "fallback_used" : FALLBACK_USED ,
9297 },
93- )
98+ )
You can’t perform that action at this time.
0 commit comments