Skip to content

Commit 37577ba

Browse files
committed
Fix condition
1 parent 79dbded commit 37577ba

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

mkdocs_rss_plugin/util.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -378,14 +378,17 @@ def get_description_or_abstract(
378378
"because an item must have a description."
379379
)
380380
return ""
381-
elif abstract_delimiter:
382-
if (
381+
elif (
382+
abstract_delimiter
383+
and (
383384
excerpt_separator_position := in_page.markdown.find(abstract_delimiter)
384-
) > -1:
385-
return markdown.markdown(
386-
in_page.markdown[:excerpt_separator_position],
387-
output_format="html5",
388-
)
385+
)
386+
> -1
387+
):
388+
return markdown.markdown(
389+
in_page.markdown[:excerpt_separator_position],
390+
output_format="html5",
391+
)
389392
# If chars count is unlimited, use the html content
390393
elif in_page.content and chars_count == -1:
391394
if chars_count is None or len(in_page.content) < chars_count:

0 commit comments

Comments
 (0)