Commit 6e606aa0 authored by Miguel Angel Reina Ortega's avatar Miguel Angel Reina Ortega
Browse files

Allow clauses such as ZA, ZB, etc..

parent 7d4c992f
Loading
Loading
Loading
Loading
Loading
+2 −2
Changes for generateSpecWebSite/markdownTools.py: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -540,9 +540,9 @@ def analyseMarkdown(filename:Optional[str]=None, inLines:Optional[list[str]]=Non
			# Add a new clause
			clauseTitle = m.groups()[1].strip()
			clauseTitle = re.sub(matchHtmlTag, '', clauseTitle)
			headerNumber = matchHeaderNumber.search(clauseTitle)
			headerNumber = matchHeaderNumber.match(clauseTitle)
			outClauses.append(Clause(len(m.groups()[0]), # level
								   headerNumber.group() if headerNumber else _shortHash(clauseTitle, 6),
								   headerNumber.group('number') if headerNumber else _shortHash(clauseTitle, 6),
								   clauseTitle, 
								   []))
			_lineType = LineType.HEADING
+6 −1
Changes for generateSpecWebSite/regexMatches.py: 6 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -28,7 +28,12 @@ matchGridTableHeaderSeparator = re.compile(r'^\+([=:]+\+)+$', re.IGNORECASE)
matchGridTableSeparator = re.compile(r'^\+([-:=]+\+)+$', re.IGNORECASE)
matchGridTableDelimiter = re.compile(r'((?<!\\)\||(?=\+:?[-=]+:?\+)\+|(?<![^-=:])\+|\|$)', re.IGNORECASE)
matchHeader = re.compile(r'(#+)\s+(.*)', re.IGNORECASE)
matchHeaderNumber = re.compile(r'\b[A-Za-z0-9]\d*(\.\d+)*\b', re.IGNORECASE)
# Leading clause number only. "ZB.0 Context" is ZB.0, "Annex ZB (informative): ..." is ZB.
# A later number, such as a year in the annex title, is not part of the clause number.
matchHeaderNumber = re.compile(
	r'^(?:Annex\s+)?(?P<number>[A-Za-z]{1,3}\d*(?:\.\d+)*|\d+(?:\.\d+)*)\b',
	re.IGNORECASE,
)
matchListInContent = re.compile(r'^(?:\s*(P<marker>[-*+]|\s*\d+\.))\s+(P<content>.+)$', re.IGNORECASE)
matchNote = re.compile(r'^\s*>\s*', re.IGNORECASE)
matchNoteStart = re.compile(r'^\s*>\s*(note)?\s*[:]?\s*', re.IGNORECASE)