Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add wiki title search #7264

Merged
merged 1 commit into from
Jan 3, 2025
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 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
Loading