From 100120f76cd8fea391733aaf4a6555257793aaad Mon Sep 17 00:00:00 2001 From: James Lu Date: Sat, 13 May 2023 12:09:52 -0700 Subject: [PATCH] Wikifetch: replace embedded \n with commas (for bulleted lists) --- Wikifetch/formatter.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Wikifetch/formatter.py b/Wikifetch/formatter.py index 374efe3..aa7f8bf 100644 --- a/Wikifetch/formatter.py +++ b/Wikifetch/formatter.py @@ -28,7 +28,8 @@ def fmt_node(w, summary=False): if len(lines) > 1: s = lines[0] break - return s.strip() + # replace \n with commas, it's often used inside bulleted lists + return s.strip().replace('\n', ', ') _RE_EMPTY_PARENTHESES = re.compile(r' ?\(\s+\)') def _cleanup(text):