File tree 2 files changed +5
-4
lines changed
2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -300,9 +300,9 @@ export function Events(Base) {
300
300
*/
301
301
onRender ( ) {
302
302
const currentPath = this . router . toURL ( this . router . getCurrentPath ( ) ) ;
303
- const currentTitle = dom . find (
304
- `.sidebar a[href='${ currentPath } ']` ,
305
- ) ?. innerText ;
303
+ const currentTitle = dom
304
+ . find ( `.sidebar a[href='${ currentPath } ']` )
305
+ ?. getAttribute ( 'title' ) ;
306
306
307
307
// Update page title
308
308
dom . $ . title = currentTitle || this . #title;
Original file line number Diff line number Diff line change @@ -49,9 +49,10 @@ function doSearch(value) {
49
49
50
50
let html = '' ;
51
51
matches . forEach ( ( post , i ) => {
52
+ const title = ( post . title || '' ) . replace ( / < [ ^ > ] + > / g, '' ) ;
52
53
html += /* html */ `
53
54
<div class="matching-post" aria-label="search result ${ i + 1 } ">
54
- <a href="${ post . url } ">
55
+ <a href="${ post . url } " title=" ${ title } " >
55
56
<p class="title clamp-1">${ post . title } </p>
56
57
<p class="content clamp-2">${ post . content } </p>
57
58
</a>
You can’t perform that action at this time.
0 commit comments