Skip to content

Commit da9bfc7

Browse files
committed
Fix title generation for index page
1 parent f6d4360 commit da9bfc7

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

generate-docs.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,12 @@ class Generator {
142142
const title = body.match(/^#([^\n\r]+)/i) || []
143143

144144
let result = this._layout
145-
146-
result = result.replace(
147-
/<title>Mithril\.js<\/title>/,
148-
`<title>${title[1]} - Mithril.js</title>`
149-
)
145+
if (title[1]) {
146+
result = result.replace(
147+
/<title>Mithril\.js<\/title>/,
148+
`<title>${title[1]} - Mithril.js</title>`
149+
)
150+
}
150151

151152
// update version
152153
result = result.replace(/\[version\]/g, this._version)

0 commit comments

Comments
 (0)