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
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Fix: `/search-entries.xml` correctly constructs `title` field when text is outside a top level header
Original file line number Diff line number Diff line change
Expand Up @@ -610,8 +610,15 @@ private String searchEntryTitle(TocItem tocItem, PageSearchEntry pageSearchEntry
docMeta.getType() : pageSearchEntry.getPageSectionTitle());
}

return docMeta.getTitle() + ": " + tocItem.getPageTitle() + ", " + pageSearchEntry.getPageSectionTitle() +
String pageSectionPart = pageSearchEntry.getPageSectionTitle().isEmpty() ?
"" :
", " + pageSearchEntry.getPageSectionTitle();

String chapterPart = tocItem.getChapterTitle().isEmpty() ?
"" :
" [" + tocItem.getChapterTitle() + "]";

return docMeta.getTitle() + ": " + tocItem.getPageTitle() + pageSectionPart + chapterPart;
}

// each markup file may refer other files like code snippets or diagrams
Expand Down