File tree 2 files changed +9
-1
lines changed
2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -127,6 +127,12 @@ Only when you set both the `routerMode: 'history'` and `externalLinkTarget: '_se
127
127
### Hello, world! :id=hello-world
128
128
```
129
129
130
+ ## Customise item name for sidebar
131
+
132
+ ``` md
133
+ ### How would I write a "hello, world" example? :sidebar="Hello, world?"
134
+ ```
135
+
130
136
## Markdown in html tag
131
137
132
138
You need to insert a space between the html and markdown content.
Original file line number Diff line number Diff line change @@ -233,12 +233,14 @@ export class Compiler {
233
233
nextToc . ignoreAllSubs = true ;
234
234
}
235
235
236
+ const title = config . sidebar || str ;
236
237
const slug = slugify ( config . id || str ) ;
237
238
const url = router . toURL ( router . getCurrentPath ( ) , { id : slug } ) ;
239
+ nextToc . title = removeAtag ( title ) ;
238
240
nextToc . slug = url ;
239
241
_self . toc . push ( nextToc ) ;
240
242
241
- return `<h${ level } id="${ slug } "><a href="${ url } " data-id="${ slug } " class="anchor"><span>${ str } </span></a></h${ level } >` ;
243
+ return `<h${ level } id="${ slug } "><a href="${ url } " data-id="${ slug } " class="anchor"><span>${ title } </span></a></h${ level } >` ;
242
244
} ;
243
245
244
246
origin . code = highlightCodeCompiler ( { renderer } ) ;
You can’t perform that action at this time.
0 commit comments