fix: truncate doc title
This commit is contained in:
@@ -361,7 +361,7 @@ export class Translator {
|
|||||||
|
|
||||||
this.#eventName = genEventName();
|
this.#eventName = genEventName();
|
||||||
this.#docInfo = {
|
this.#docInfo = {
|
||||||
title: document.title,
|
title: truncateWords(document.title),
|
||||||
description: this.#getDocDescription(),
|
description: this.#getDocDescription(),
|
||||||
};
|
};
|
||||||
this.#combinedSkipsRegex = new RegExp(
|
this.#combinedSkipsRegex = new RegExp(
|
||||||
@@ -1699,7 +1699,7 @@ export class Translator {
|
|||||||
// 翻译页面标题
|
// 翻译页面标题
|
||||||
async #translateTitle() {
|
async #translateTitle() {
|
||||||
const title = document.title;
|
const title = document.title;
|
||||||
this.#docInfo.title = title;
|
this.#docInfo.title = truncateWords(title);
|
||||||
if (!title) return;
|
if (!title) return;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user