mirror of https://github.com/kiwix/libkiwix.git
Fix title='_' case too #685
This commit is contained in:
parent
cd412867d9
commit
5a9dbf85ec
|
@ -55,10 +55,11 @@
|
||||||
const humanFriendlyTitle = (title) => {
|
const humanFriendlyTitle = (title) => {
|
||||||
if (typeof title === 'string' && title.length > 0) {
|
if (typeof title === 'string' && title.length > 0) {
|
||||||
title = title.replace(/_/g, ' ');
|
title = title.replace(/_/g, ' ');
|
||||||
return htmlEncode(title[0].toUpperCase() + title.slice(1));
|
if (title.length > 0) {
|
||||||
} else {
|
return htmlEncode(title[0].toUpperCase() + title.slice(1));
|
||||||
return '';
|
}
|
||||||
}
|
}
|
||||||
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
function htmlEncode(str) {
|
function htmlEncode(str) {
|
||||||
|
|
Loading…
Reference in New Issue