Skip to content

Commit b0f801b

Browse files
authored
prioritize detailed description at top level (#87)
1 parent fd07587 commit b0f801b

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/search/doxygen-parse.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,8 @@ const doxygenMemberDefParseFns = {
124124

125125
let param: DoxygenEnumParameter = {
126126
name: paramEl.querySelector('name').textContent.trim(),
127-
initializer: paramEl.querySelector('initializer')?.textContent.trim() || '',
127+
initializer:
128+
paramEl.querySelector('initializer')?.textContent.trim() || '',
128129
access: paramEl.getAttribute('prot') as any,
129130
brief: paramEl.querySelector('briefdescription').textContent.trim(),
130131
detailedDescription: detailedDescription,
@@ -323,7 +324,6 @@ const doxygenMemberDefParseFns = {
323324

324325
const doxygenCompoundDefParseFns = {
325326
page: (def: DoxygenBaseDef, el: Element): DoxygenPageDef => {
326-
327327
return {
328328
...def,
329329
kind: 'page',
@@ -335,7 +335,6 @@ const doxygenCompoundDefParseFns = {
335335
};
336336
},
337337
file: (def: DoxygenBaseDef, el: Element): DoxygenFileDef => {
338-
339338
const sections = {
340339
define: [] as DoxygenDefineMemberDef[],
341340
enum: [] as DoxygenEnumMemberDef[],
@@ -526,8 +525,11 @@ function doxygenInnerNamespace(el: Element): DoxygenInnerNamespaceDef {
526525

527526
function getDetailedDescription(el: Element): DoxygenParagraph[] {
528527
const detailedDescription: DoxygenParagraph[] = [];
529-
const detailedDescEl = el.querySelector('detaileddescription');
530-
528+
const detailedDescEl =
529+
Array.from(el.children).find(
530+
el => el.nodeName.toLowerCase() === 'detaileddescription',
531+
) || el.querySelector('detaileddescription');
532+
531533
if (detailedDescEl) {
532534
for (const para of Array.from(detailedDescEl.children)) {
533535
const doxygenParagraph = getDoxygenParagraph(para);

0 commit comments

Comments
 (0)