fix: inspect emphasized Korean prose endings
This commit is contained in:
@@ -149,6 +149,7 @@ def reader_prose_segments(markdown: str) -> list[ReaderProseSegment]:
|
|||||||
for quoted_span in _QUOTED_SPANS:
|
for quoted_span in _QUOTED_SPANS:
|
||||||
prose = quoted_span.sub("", prose)
|
prose = quoted_span.sub("", prose)
|
||||||
prose = re.sub(r"^\s*(?:[-*+]|\d+[.)])\s+", "", prose).strip()
|
prose = re.sub(r"^\s*(?:[-*+]|\d+[.)])\s+", "", prose).strip()
|
||||||
|
prose = re.sub(r"[*_~]", "", prose).strip()
|
||||||
if prose:
|
if prose:
|
||||||
segments.append(ReaderProseSegment(prose, line_number, current_h2))
|
segments.append(ReaderProseSegment(prose, line_number, current_h2))
|
||||||
|
|
||||||
|
|||||||
@@ -214,6 +214,19 @@ class LintTests(unittest.TestCase):
|
|||||||
self.assertIn("STYLE002", {issue.code for issue in report.issues})
|
self.assertIn("STYLE002", {issue.code for issue in report.issues})
|
||||||
self.assertEqual(report.metrics["plain_form_ending_count"], 1)
|
self.assertEqual(report.metrics["plain_form_ending_count"], 1)
|
||||||
|
|
||||||
|
def test_korean_experience_contract_blocks_emphasized_plain_ending(self) -> None:
|
||||||
|
brief = self._korean_experience_brief()
|
||||||
|
sources = make_sources()
|
||||||
|
text, outline = self._experience_document(
|
||||||
|
brief,
|
||||||
|
extra_by_section={0: "**현재 구현은 이 값을 사용한다.**"},
|
||||||
|
)
|
||||||
|
|
||||||
|
report = lint_document(text, brief, outline, sources)
|
||||||
|
|
||||||
|
self.assertIn("STYLE002", {issue.code for issue in report.issues})
|
||||||
|
self.assertEqual(report.metrics["plain_form_ending_count"], 1)
|
||||||
|
|
||||||
def test_korean_style_lint_exempts_non_reader_prose(self) -> None:
|
def test_korean_style_lint_exempts_non_reader_prose(self) -> None:
|
||||||
brief = self._korean_experience_brief()
|
brief = self._korean_experience_brief()
|
||||||
sources = make_sources()
|
sources = make_sources()
|
||||||
|
|||||||
Reference in New Issue
Block a user