Fix bugs caused by the previous version, fixed #56
This commit is contained in:
parent
8630591bd2
commit
fb8bf89d73
3 changed files with 10 additions and 1 deletions
|
|
@ -160,9 +160,12 @@ export function renderCover (content) {
|
|||
if (renderCover.rendered) return event.sticky()
|
||||
|
||||
// render cover
|
||||
const cacheToc = toc.slice()
|
||||
let html = markdown(content)
|
||||
const match = html.trim().match('<p><img[^s]+src="(.*?)"[^a]+alt="(.*?)">([^<]*?)</p>$')
|
||||
|
||||
toc = cacheToc.slice()
|
||||
|
||||
// render background
|
||||
if (match) {
|
||||
const coverEl = document.querySelector('section.cover')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue