Skip to content

Commit 956a7f3

Browse files
committed
Issue 5: process div with style yinxiang type
1 parent 721ccd7 commit 956a7f3

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

html2notion/translate/html2json_clipper.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,6 @@ def get_block_type(self, element):
5959
return Block.NUMBERED_LIST.value
6060
elif tag_name == 'ul':
6161
return Block.BULLETED_LIST.value
62-
elif tag_name == 'p':
63-
return Block.PARAGRAPH.value
6462
elif element.name == 'pre' and element.code:
6563
return Block.CODE.value
6664
elif self._check_is_block(element):

html2notion/translate/html2json_yinxiang.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,6 @@ def get_block_type(self, single_tag):
156156
return Block.HEADING.value
157157
elif tag_name == 'table' or self._check_is_table(single_tag):
158158
return Block.TABLE.value
159-
if not style and tag_name == 'div':
160-
return Block.PARAGRAPH.value
161159

162160
css_dict = {}
163161
if style:
@@ -172,6 +170,9 @@ def get_block_type(self, single_tag):
172170
if css_dict.get('-en-codeblock', None) == 'true':
173171
return Block.CODE.value
174172

173+
# Issue 5: <div style="orphans: 2; widows: 2">
174+
if tag_name == 'div':
175+
return Block.PARAGRAPH.value
175176
return Block.FAIL.value
176177

177178
def _check_is_table(self, tag):

0 commit comments

Comments
 (0)