From 6748c3cc91f90bddea3d07b8b30a049ee55eaf35 Mon Sep 17 00:00:00 2001
From: Kelly Brazil <kellyjonbrazil@gmail.com>
Date: Thu, 24 Mar 2022 09:31:12 -0700
Subject: [PATCH] remove lines from corner detection and add rounded corners

---
 jc/parsers/asciitable.py   | 52 ++++++++++++++-------------
 jc/parsers/asciitable_m.py | 74 +++++++++++++++++++-------------------
 2 files changed, 65 insertions(+), 61 deletions(-)

diff --git a/jc/parsers/asciitable.py b/jc/parsers/asciitable.py
index 9346278c..de4cb56c 100644
--- a/jc/parsers/asciitable.py
+++ b/jc/parsers/asciitable.py
@@ -168,31 +168,33 @@ def _is_separator(line: str) -> bool:
     """Returns true if a table separator line is found"""
     strip_line = line.strip()
     if any((
-        strip_line.startswith('╒═') and strip_line.endswith('═╕'),
-        strip_line.startswith('╞═') and strip_line.endswith('═╡'),
-        strip_line.startswith('╘═') and strip_line.endswith('═╛'),
-        strip_line.startswith('┏━') and strip_line.endswith('━┓'),
-        strip_line.startswith('┣━') and strip_line.endswith('━┫'),
-        strip_line.startswith('┗━') and strip_line.endswith('━┛'),
-        strip_line.startswith('┡━') and strip_line.endswith('━┩'),
-        strip_line.startswith('┢━') and strip_line.endswith('━┪'),
-        strip_line.startswith('┟─') and strip_line.endswith('─┧'),
-        strip_line.startswith('┞─') and strip_line.endswith('─┦'),
-        strip_line.startswith('┠─') and strip_line.endswith('─┨'),
-        strip_line.startswith('┝━') and strip_line.endswith('━┥'),
-        strip_line.startswith('┍━') and strip_line.endswith('━┑'),
-        strip_line.startswith('┕━') and strip_line.endswith('━┙'),
-        strip_line.startswith('┎─') and strip_line.endswith('─┒'),
-        strip_line.startswith('┖─') and strip_line.endswith('─┚'),
-        strip_line.startswith('╓─') and strip_line.endswith('─╖'),
-        strip_line.startswith('╟─') and strip_line.endswith('─╢'),
-        strip_line.startswith('╙─') and strip_line.endswith('─╜'),
-        strip_line.startswith('╔═') and strip_line.endswith('═╗'),
-        strip_line.startswith('╠═') and strip_line.endswith('═╣'),
-        strip_line.startswith('╚═') and strip_line.endswith('═╝'),
-        strip_line.startswith('┌─') and strip_line.endswith('─┐'),
-        strip_line.startswith('├─') and strip_line.endswith('─┤'),
-        strip_line.startswith('└─') and strip_line.endswith('─┘'),
+        strip_line.startswith('╒') and strip_line.endswith('╕'),
+        strip_line.startswith('╞') and strip_line.endswith('╡'),
+        strip_line.startswith('╘') and strip_line.endswith('╛'),
+        strip_line.startswith('┏') and strip_line.endswith('┓'),
+        strip_line.startswith('┣') and strip_line.endswith('┫'),
+        strip_line.startswith('┗') and strip_line.endswith('┛'),
+        strip_line.startswith('┡') and strip_line.endswith('┩'),
+        strip_line.startswith('┢') and strip_line.endswith('┪'),
+        strip_line.startswith('┟') and strip_line.endswith('┧'),
+        strip_line.startswith('┞') and strip_line.endswith('┦'),
+        strip_line.startswith('┠') and strip_line.endswith('┨'),
+        strip_line.startswith('┝') and strip_line.endswith('┥'),
+        strip_line.startswith('┍') and strip_line.endswith('┑'),
+        strip_line.startswith('┕') and strip_line.endswith('┙'),
+        strip_line.startswith('┎') and strip_line.endswith('┒'),
+        strip_line.startswith('┖') and strip_line.endswith('┚'),
+        strip_line.startswith('╓') and strip_line.endswith('╖'),
+        strip_line.startswith('╟') and strip_line.endswith('╢'),
+        strip_line.startswith('╙') and strip_line.endswith('╜'),
+        strip_line.startswith('╔') and strip_line.endswith('╗'),
+        strip_line.startswith('╠') and strip_line.endswith('╣'),
+        strip_line.startswith('╚') and strip_line.endswith('╝'),
+        strip_line.startswith('┌') and strip_line.endswith('┐'),
+        strip_line.startswith('├') and strip_line.endswith('┤'),
+        strip_line.startswith('└') and strip_line.endswith('┘'),
+        strip_line.startswith('╭') and strip_line.endswith('╮'),
+        strip_line.startswith('╰') and strip_line.endswith('╯'),
         strip_line.startswith('━━') and strip_line.endswith('━━'),
         strip_line.startswith('──') and strip_line.endswith('──'),
         strip_line.startswith('┄┄') and strip_line.endswith('┄┄'),
diff --git a/jc/parsers/asciitable_m.py b/jc/parsers/asciitable_m.py
index 6ad45640..e5f1a914 100644
--- a/jc/parsers/asciitable_m.py
+++ b/jc/parsers/asciitable_m.py
@@ -160,17 +160,17 @@ def _table_sniff(string: str) -> str:
     for line in string.splitlines():
         line = line.strip()
         if any((
-            line.startswith('╞═') and line.endswith('═╡'),
-            line.startswith('├─') and line.endswith('─┤'),
-            line.startswith('┡━') and line.endswith('━┩'),
-            line.startswith('┣━') and line.endswith('━┫'),
-            line.startswith('┢━') and line.endswith('━┪'),
-            line.startswith('┟─') and line.endswith('─┧'),
-            line.startswith('┞─') and line.endswith('─┦'),
-            line.startswith('┠─') and line.endswith('─┨'),
-            line.startswith('┝━') and line.endswith('━┥'),
-            line.startswith('╟─') and line.endswith('─╢'),
-            line.startswith('╠═') and line.endswith('═╣'),
+            line.startswith('╞') and line.endswith('╡'),
+            line.startswith('├') and line.endswith('┤'),
+            line.startswith('┡') and line.endswith('┩'),
+            line.startswith('┣') and line.endswith('┫'),
+            line.startswith('┢') and line.endswith('┪'),
+            line.startswith('┟') and line.endswith('┧'),
+            line.startswith('┞') and line.endswith('┦'),
+            line.startswith('┠') and line.endswith('┨'),
+            line.startswith('┝') and line.endswith('┥'),
+            line.startswith('╟') and line.endswith('╢'),
+            line.startswith('╠') and line.endswith('╣'),
             line.startswith('+=') and line.endswith('=+'),
             line.startswith('+-') and line.endswith('-+')
         )):
@@ -189,31 +189,33 @@ def _is_separator(line: str) -> bool:
     """Returns true if a table separator line is found"""
     strip_line = line.strip()
     if any((
-        strip_line.startswith('╒═') and strip_line.endswith('═╕'),
-        strip_line.startswith('╞═') and strip_line.endswith('═╡'),
-        strip_line.startswith('╘═') and strip_line.endswith('═╛'),
-        strip_line.startswith('┏━') and strip_line.endswith('━┓'),
-        strip_line.startswith('┣━') and strip_line.endswith('━┫'),
-        strip_line.startswith('┗━') and strip_line.endswith('━┛'),
-        strip_line.startswith('┡━') and strip_line.endswith('━┩'),
-        strip_line.startswith('┢━') and strip_line.endswith('━┪'),
-        strip_line.startswith('┟─') and strip_line.endswith('─┧'),
-        strip_line.startswith('┞─') and strip_line.endswith('─┦'),
-        strip_line.startswith('┠─') and strip_line.endswith('─┨'),
-        strip_line.startswith('┝━') and strip_line.endswith('━┥'),
-        strip_line.startswith('┍━') and strip_line.endswith('━┑'),
-        strip_line.startswith('┕━') and strip_line.endswith('━┙'),
-        strip_line.startswith('┎─') and strip_line.endswith('─┒'),
-        strip_line.startswith('┖─') and strip_line.endswith('─┚'),
-        strip_line.startswith('╓─') and strip_line.endswith('─╖'),
-        strip_line.startswith('╟─') and strip_line.endswith('─╢'),
-        strip_line.startswith('╙─') and strip_line.endswith('─╜'),
-        strip_line.startswith('╔═') and strip_line.endswith('═╗'),
-        strip_line.startswith('╠═') and strip_line.endswith('═╣'),
-        strip_line.startswith('╚═') and strip_line.endswith('═╝'),
-        strip_line.startswith('┌─') and strip_line.endswith('─┐'),
-        strip_line.startswith('├─') and strip_line.endswith('─┤'),
-        strip_line.startswith('└─') and strip_line.endswith('─┘'),
+        strip_line.startswith('╒') and strip_line.endswith('╕'),
+        strip_line.startswith('╞') and strip_line.endswith('╡'),
+        strip_line.startswith('╘') and strip_line.endswith('╛'),
+        strip_line.startswith('┏') and strip_line.endswith('┓'),
+        strip_line.startswith('┣') and strip_line.endswith('┫'),
+        strip_line.startswith('┗') and strip_line.endswith('┛'),
+        strip_line.startswith('┡') and strip_line.endswith('┩'),
+        strip_line.startswith('┢') and strip_line.endswith('┪'),
+        strip_line.startswith('┟') and strip_line.endswith('┧'),
+        strip_line.startswith('┞') and strip_line.endswith('┦'),
+        strip_line.startswith('┠') and strip_line.endswith('┨'),
+        strip_line.startswith('┝') and strip_line.endswith('┥'),
+        strip_line.startswith('┍') and strip_line.endswith('┑'),
+        strip_line.startswith('┕') and strip_line.endswith('┙'),
+        strip_line.startswith('┎') and strip_line.endswith('┒'),
+        strip_line.startswith('┖') and strip_line.endswith('┚'),
+        strip_line.startswith('╓') and strip_line.endswith('╖'),
+        strip_line.startswith('╟') and strip_line.endswith('╢'),
+        strip_line.startswith('╙') and strip_line.endswith('╜'),
+        strip_line.startswith('╔') and strip_line.endswith('╗'),
+        strip_line.startswith('╠') and strip_line.endswith('╣'),
+        strip_line.startswith('╚') and strip_line.endswith('╝'),
+        strip_line.startswith('┌') and strip_line.endswith('┐'),
+        strip_line.startswith('├') and strip_line.endswith('┤'),
+        strip_line.startswith('└') and strip_line.endswith('┘'),
+        strip_line.startswith('╭') and strip_line.endswith('╮'),
+        strip_line.startswith('╰') and strip_line.endswith('╯'),
         strip_line.startswith('+=') and strip_line.endswith('=+'),
         strip_line.startswith('+-') and strip_line.endswith('-+')
     )):