File tree 1 file changed +7
-8
lines changed
1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -135,14 +135,13 @@ def convert_soup(self, soup):
135
135
def process_tag (self , node , convert_as_inline ):
136
136
text = ''
137
137
138
- # markdown headings or cells can't include
139
- # block elements (elements w/newlines)
140
- isHeading = html_heading_re .match (node .name ) is not None
141
- isCell = node .name in ['td' , 'th' ]
142
- convert_children_as_inline = convert_as_inline
143
-
144
- if isHeading or isCell :
145
- convert_children_as_inline = True
138
+ # For Markdown headings and table cells, convert children as inline
139
+ # (so that block element children do not produce newlines).
140
+ convert_children_as_inline = (
141
+ convert_as_inline # propagated from parent
142
+ or html_heading_re .match (node .name ) is not None # headings
143
+ or node .name in ['td' , 'th' ] # table cells
144
+ )
146
145
147
146
# Remove whitespace-only textnodes just before, after or
148
147
# inside block-level elements.
You can’t perform that action at this time.
0 commit comments