Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ford/sourceform.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ def markdown(self, md: MetaMarkdown):
)

if self.meta.summary is not None:
self.meta.summary = md.convert("\n".join(self.meta.summary), context=self)
self.meta.summary = md.convert(" ".join(self.meta.summary.split()), context=self)
elif paragraph := PARA_CAPTURE_RE.search(self.doc):
# If there is no stand-alone webpage for this item, e.g.
# an internal routine, make the whole doc blob appear,
Expand Down
21 changes: 21 additions & 0 deletions test/test_sourceform.py
Original file line number Diff line number Diff line change
Expand Up @@ -2268,3 +2268,24 @@ def test_no_space_after_character_type(parse_fortran_file):
source = parse_fortran_file(data)
function = source.functions[0]
assert function.name.lower() == "firstword"


def test_summary_handling_bug703(parse_fortran_file):
"""Check that `summary` works, PR #703"""
data = """\
!> summary: Lorem ipsum dolor sit amet, consectetur adipiscing elit.
!> Fusce ultrices tortor et felis tempus vehicula.
!> Nulla gravida, magna ut pharetra.
!>
!> Full description
module test
end module myModule
"""

fortran_file = parse_fortran_file(data)
md = MetaMarkdown()

module = fortran_file.modules[0]
module.markdown(md)

assert "Lorem ipsum" in module.meta.summary