Skip to content

Commit

Permalink
feat: add wiki title search (#7264)
Browse files Browse the repository at this point in the history
  • Loading branch information
cir9no authored Jan 3, 2025
1 parent d5acdb8 commit 3795c05
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion frontend/src/components/search/wiki2-search-result.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
overflow: hidden;
}

.wiki2-search-result-bottom mark {
.wiki2-search-result mark {
padding: 0;
background: yellow;
}
Expand Down
6 changes: 4 additions & 2 deletions frontend/src/components/search/wiki2-search-result.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { gettext } from '../../utils/constants';
import './wiki2-search-result.css';

function Wiki2SearchResult({ result, getCurrentPageId, setCurrentPage, resetToDefault, setRef, isHighlight }) {
const { content, page } = result;
const { content, page, title } = result;
const currentPageId = getCurrentPageId();
const isCurrentPage = currentPageId === page.id;
return (
Expand All @@ -19,7 +19,9 @@ function Wiki2SearchResult({ result, getCurrentPageId, setCurrentPage, resetToDe
>
<div className='wiki2-search-result-top d-flex align-items-center'>
{page.icon ? <CustomIcon icon={page.icon} /> : <NavItemIcon symbol={'file'} disable={true} />}
<span className='wiki2-search-result-page-name text-truncate' title={page.name} style={isCurrentPage ? { width: 'auto' } : { width: 700 }}>{page.name}</span>
<span className='wiki2-search-result-page-name text-truncate' title={page.name} style={isCurrentPage ? { width: 'auto' } : { width: 700 }}>
{title ? <span dangerouslySetInnerHTML={{ __html: title }}></span> : page.name}
</span>
{isCurrentPage ?
<span className='wiki2-search-result-current'>{gettext('Current page')}</span> :
<span className='wiki2-search-result-enter sf3-font sf3-font-enter' style={isHighlight ? { opacity: 1 } : {}}></span>
Expand Down

0 comments on commit 3795c05

Please sign in to comment.