Fix: remove all html-attributes from shortDescriptions in the theme overview
This commit is contained in:
parent
d9b8257e47
commit
39572f4767
2 changed files with 26 additions and 23 deletions
|
@ -1,10 +1,10 @@
|
||||||
import * as fs from "fs"
|
import * as fs from "fs"
|
||||||
import { DesugaringStep } from "../Models/ThemeConfig/Conversion/Conversion"
|
import { DesugaringStep } from "../src/Models/ThemeConfig/Conversion/Conversion"
|
||||||
import { LayerConfigJson } from "../Models/ThemeConfig/Json/LayerConfigJson"
|
import { LayerConfigJson } from "../src/Models/ThemeConfig/Json/LayerConfigJson"
|
||||||
import { QuestionableTagRenderingConfigJson } from "../Models/ThemeConfig/Json/QuestionableTagRenderingConfigJson"
|
import { QuestionableTagRenderingConfigJson } from "../src/Models/ThemeConfig/Json/QuestionableTagRenderingConfigJson"
|
||||||
import * as fakedom from "fake-dom"
|
import * as fakedom from "fake-dom"
|
||||||
import Script from "./Script"
|
import Script from "./Script"
|
||||||
import { FixedUiElement } from "../UI/Base/FixedUiElement"
|
import { FixedUiElement } from "../src/UI/Base/FixedUiElement"
|
||||||
|
|
||||||
class ExtractQuestionHint extends DesugaringStep<QuestionableTagRenderingConfigJson> {
|
class ExtractQuestionHint extends DesugaringStep<QuestionableTagRenderingConfigJson> {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
|
|
@ -1,26 +1,26 @@
|
||||||
import ScriptUtils from "./ScriptUtils"
|
import ScriptUtils from "./ScriptUtils";
|
||||||
import { existsSync, mkdirSync, readFileSync, statSync, writeFileSync } from "fs"
|
import { existsSync, mkdirSync, readFileSync, statSync, writeFileSync } from "fs";
|
||||||
import licenses from "../src/assets/generated/license_info.json"
|
import licenses from "../src/assets/generated/license_info.json";
|
||||||
import { LayoutConfigJson } from "../src/Models/ThemeConfig/Json/LayoutConfigJson"
|
import { LayoutConfigJson } from "../src/Models/ThemeConfig/Json/LayoutConfigJson";
|
||||||
import { LayerConfigJson } from "../src/Models/ThemeConfig/Json/LayerConfigJson"
|
import { LayerConfigJson } from "../src/Models/ThemeConfig/Json/LayerConfigJson";
|
||||||
import Constants from "../src/Models/Constants"
|
import Constants from "../src/Models/Constants";
|
||||||
import {
|
import {
|
||||||
DetectDuplicateFilters,
|
DetectDuplicateFilters,
|
||||||
DoesImageExist,
|
DoesImageExist,
|
||||||
PrevalidateTheme,
|
PrevalidateTheme,
|
||||||
ValidateLayer,
|
ValidateLayer,
|
||||||
ValidateThemeAndLayers,
|
ValidateThemeAndLayers
|
||||||
} from "../src/Models/ThemeConfig/Conversion/Validation"
|
} from "../src/Models/ThemeConfig/Conversion/Validation";
|
||||||
import { Translation } from "../src/UI/i18n/Translation"
|
import { Translation } from "../src/UI/i18n/Translation";
|
||||||
import { TagRenderingConfigJson } from "../src/Models/ThemeConfig/Json/TagRenderingConfigJson"
|
import { TagRenderingConfigJson } from "../src/Models/ThemeConfig/Json/TagRenderingConfigJson";
|
||||||
import PointRenderingConfigJson from "../src/Models/ThemeConfig/Json/PointRenderingConfigJson"
|
import PointRenderingConfigJson from "../src/Models/ThemeConfig/Json/PointRenderingConfigJson";
|
||||||
import { PrepareLayer } from "../src/Models/ThemeConfig/Conversion/PrepareLayer"
|
import { PrepareLayer } from "../src/Models/ThemeConfig/Conversion/PrepareLayer";
|
||||||
import { PrepareTheme } from "../src/Models/ThemeConfig/Conversion/PrepareTheme"
|
import { PrepareTheme } from "../src/Models/ThemeConfig/Conversion/PrepareTheme";
|
||||||
import { DesugaringContext } from "../src/Models/ThemeConfig/Conversion/Conversion"
|
import { DesugaringContext } from "../src/Models/ThemeConfig/Conversion/Conversion";
|
||||||
import { Utils } from "../src/Utils"
|
import { Utils } from "../src/Utils";
|
||||||
import Script from "./Script"
|
import Script from "./Script";
|
||||||
import { AllSharedLayers } from "../src/Customizations/AllSharedLayers"
|
import { AllSharedLayers } from "../src/Customizations/AllSharedLayers";
|
||||||
|
import {parse as parse_html} from "node-html-parser"
|
||||||
// This scripts scans 'src/assets/layers/*.json' for layer definition files and 'src/assets/themes/*.json' for theme definition files.
|
// This scripts scans 'src/assets/layers/*.json' for layer definition files and 'src/assets/themes/*.json' for theme definition files.
|
||||||
// It spits out an overview of those to be used to load them
|
// It spits out an overview of those to be used to load them
|
||||||
|
|
||||||
|
@ -516,7 +516,10 @@ class LayerOverviewUtils extends Script {
|
||||||
hideFromOverview: t.hideFromOverview ?? false,
|
hideFromOverview: t.hideFromOverview ?? false,
|
||||||
shortDescription:
|
shortDescription:
|
||||||
t.shortDescription ??
|
t.shortDescription ??
|
||||||
new Translation(t.description).FirstSentence().translations,
|
new Translation(t.description)
|
||||||
|
.FirstSentence()
|
||||||
|
.OnEveryLanguage(s => parse_html(s).innerText)
|
||||||
|
.translations,
|
||||||
mustHaveLanguage: t.mustHaveLanguage?.length > 0,
|
mustHaveLanguage: t.mustHaveLanguage?.length > 0,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue