Added Chapter Title as heading in Chapters (#2538)
This commit is contained in:
@@ -9,7 +9,7 @@ class WTRLAB implements Plugin.PluginBase {
|
|||||||
id = 'WTRLAB';
|
id = 'WTRLAB';
|
||||||
name = 'WTR-LAB';
|
name = 'WTR-LAB';
|
||||||
site = 'https://wtr-lab.com/';
|
site = 'https://wtr-lab.com/';
|
||||||
version = '1.2.0';
|
version = '1.2.1';
|
||||||
icon = 'src/en/wtrlab/icon.png';
|
icon = 'src/en/wtrlab/icon.png';
|
||||||
sourceLang = 'en/';
|
sourceLang = 'en/';
|
||||||
baggage = '';
|
baggage = '';
|
||||||
@@ -546,7 +546,7 @@ class WTRLAB implements Plugin.PluginBase {
|
|||||||
combined = new Uint8Array(ciphertext.length + tag.length);
|
combined = new Uint8Array(ciphertext.length + tag.length);
|
||||||
|
|
||||||
// Make the ciphertext + tag format expected for decryption
|
// Make the ciphertext + tag format expected for decryption
|
||||||
(combined.set(ciphertext), combined.set(tag, ciphertext.length));
|
combined.set(ciphertext), combined.set(tag, ciphertext.length);
|
||||||
|
|
||||||
// Decrypt with encKey
|
// Decrypt with encKey
|
||||||
// Convert the key to bytes (first 32 characters of encKey)
|
// Convert the key to bytes (first 32 characters of encKey)
|
||||||
@@ -768,11 +768,15 @@ class WTRLAB implements Plugin.PluginBase {
|
|||||||
console.error(errorMsg);
|
console.error(errorMsg);
|
||||||
throw new Error(errorMsg);
|
throw new Error(errorMsg);
|
||||||
}
|
}
|
||||||
let chapterContent = parsedJson.data.data.body;
|
let chapterContent: any = parsedJson.data.data.body;
|
||||||
|
const chapterTitle: string | undefined = parsedJson?.chapter?.title;
|
||||||
const chapterGlossary: ChapterContent['glossary_data'] | undefined =
|
const chapterGlossary: ChapterContent['glossary_data'] | undefined =
|
||||||
parsedJson?.data?.data?.glossary_data;
|
parsedJson?.data?.data?.glossary_data;
|
||||||
|
|
||||||
let htmlString = '';
|
let htmlString = '';
|
||||||
|
if (chapterTitle) {
|
||||||
|
htmlString += `<h3>${chapterTitle}</h3>`;
|
||||||
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
chapterContent.toString().startsWith('arr:') ||
|
chapterContent.toString().startsWith('arr:') ||
|
||||||
|
|||||||
Reference in New Issue
Block a user