File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,4 +11,5 @@ trafilatura
1111https://github.com/opendatalab/magic-html/releases/download/magic_html-0.1.5-released/magic_html-0.1.5-py3-none-any.whl
1212streamlit
1313markdown
14- jieba
14+ jieba
15+ apted
Original file line number Diff line number Diff line change @@ -294,16 +294,12 @@ def is_md_separator_line(line):
294294 # 检查是否所有部分都是分隔符格式
295295 for p in parts :
296296 if p and not re .match (r"^:?\-{3,}:?$" , p ):
297-
298- # if p and not re.match(r"^:?\-+(:?)$", p): # 调整正则为允许1个及以上短横线
299297 return False
300298 return True
301299
302300 def save_table ():
303301 """保存当前表格并清空缓存"""
304302 nonlocal table_lines
305- # # 原逻辑要求至少2行且第2行是分隔行,改为只要有2行及以上且包含至少1个分隔行即可
306- # if len(table_lines) >= 2 and any(is_md_separator_line(line) for line in table_lines):
307303 # 只有当表格行数大于等于2,且第二行是分隔行时才保存
308304 if len (table_lines ) >= 2 and is_md_separator_line (table_lines [1 ]):
309305 md_table = '\n ' .join (table_lines )
You can’t perform that action at this time.
0 commit comments