Skip to content

Commit 0f76574

Browse files
authored
Merge branch 'develop' into search-filter-md-pure
2 parents 7e00f57 + e204ac6 commit 0f76574

File tree

5 files changed

+35
-17
lines changed

5 files changed

+35
-17
lines changed

docs/markdown.md

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Markdown configuration
22

3-
**docsify** uses [marked](https://github.com/markedjs/marked) as its Markdown parser. You can customize how it renders your Markdown content to HTML by customizing `renderer`:
3+
**docsify** uses [marked v13+](https://github.com/markedjs/marked) as its Markdown parser. You can customize how it renders your Markdown content to HTML by customizing `renderer`:
44

55
```js
66
window.$docsify = {
@@ -31,23 +31,24 @@ window.$docsify = {
3131

3232
## Supports mermaid
3333

34+
!> Currently, docsify doesn't support the async mermaid render (the latest mermaid version supported is `v9.3.0`).
35+
3436
```js
35-
// Import mermaid
3637
// <link rel="stylesheet" href="//cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.css">
37-
// <script src="//cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js"></script>
38+
// <script src="//cdn.jsdelivr.net/npm/mermaid@9.3.0/dist/mermaid.min.js"></script>
3839

3940
let num = 0;
4041
mermaid.initialize({ startOnLoad: false });
4142

4243
window.$docsify = {
4344
markdown: {
4445
renderer: {
45-
code(code, lang) {
46+
code({ text, lang }) {
4647
if (lang === 'mermaid') {
4748
return /* html */ `
4849
<div class="mermaid">${mermaid.render(
4950
'mermaid-svg-' + num++,
50-
code,
51+
text,
5152
)}</div>
5253
`;
5354
}

package-lock.json

+16-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"devDependencies": {
4646
"@babel/eslint-parser": "^7.24.5",
4747
"@babel/preset-env": "^7.11.5",
48-
"@eslint/js": "^9.3.0",
48+
"@eslint/js": "^10.0.0",
4949
"@playwright/test": "^1.44.0",
5050
"@rollup/plugin-babel": "^6.0.4",
5151
"@rollup/plugin-commonjs": "^26.0.1",

src/core/event/index.js

+10-3
Original file line numberDiff line numberDiff line change
@@ -299,10 +299,17 @@ export function Events(Base) {
299299
* @void
300300
*/
301301
onRender() {
302+
const { name } = this.config;
302303
const currentPath = this.router.toURL(this.router.getCurrentPath());
303-
const currentTitle = dom.find(
304-
`.sidebar a[href='${currentPath}']`,
305-
)?.innerText;
304+
const currentSection = dom
305+
.find(`.sidebar a[href='${currentPath}']`)
306+
?.getAttribute('title');
307+
308+
const currentTitle = name
309+
? currentSection
310+
? `${currentSection} - ${name}`
311+
: name
312+
: currentSection;
306313

307314
// Update page title
308315
dom.$.title = currentTitle || this.#title;

src/plugins/search/component.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,10 @@ function doSearch(value) {
5050
let html = '';
5151
matches.forEach((post, i) => {
5252
const content = post.content ? `...${post.content}...` : '';
53+
const title = (post.title || '').replace(/<[^>]+>/g, '');
5354
html += /* html */ `
5455
<div class="matching-post" aria-label="search result ${i + 1}">
55-
<a href="${post.url}">
56+
<a href="${post.url}" title="${title}">
5657
<p class="title clamp-1">${post.title}</p>
5758
<p class="content clamp-2">${content}</p>
5859
</a>

0 commit comments

Comments
 (0)