Unverified Commit a19089a9 authored by Xiaomeng Zhao's avatar Xiaomeng Zhao Committed by GitHub
Browse files

Merge pull request #1894 from myhloli/dev

fix(pre_proc): add Discarded block type to span block type compatibility
parents cf15c065 7a856804
......@@ -62,7 +62,15 @@ def merge_spans_to_line(spans, threshold=0.6):
def span_block_type_compatible(span_type, block_type):
if span_type in [ContentType.Text, ContentType.InlineEquation]:
return block_type in [BlockType.Text, BlockType.Title, BlockType.ImageCaption, BlockType.ImageFootnote, BlockType.TableCaption, BlockType.TableFootnote]
return block_type in [
BlockType.Text,
BlockType.Title,
BlockType.ImageCaption,
BlockType.ImageFootnote,
BlockType.TableCaption,
BlockType.TableFootnote,
BlockType.Discarded
]
elif span_type == ContentType.InterlineEquation:
return block_type in [BlockType.InterlineEquation, BlockType.Text]
elif span_type == ContentType.Image:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment