Merge branch 'develop' into waste-theme

This commit is contained in:
Pieter Vander Vennet 2022-02-20 00:47:21 +01:00
commit 9b7a47136c
89 changed files with 2775 additions and 1151 deletions

View file

@ -31,7 +31,7 @@ class ConvertImagesToIcon extends DesugaringStep<LayerConfigJson> {
}
information.push("Replaced image " + images[0])
const replaced = then.OnEveryLanguage((s) => {
return s.replace(/(<div [^>]*>)?<img [^>]*> ?/, "").replace(/<\/div>$/, "")
return s.replace(/(<div [^>]*>)?<img [^>]*> ?/, "").replace(/<\/div>$/, "").trim()
})
mapping.then = replaced.translations

View file

@ -169,7 +169,7 @@ class LayerOverviewUtils {
for (const sharedLayerJson of layerFiles) {
const context = "While building builtin layer " + sharedLayerJson.path
const fixed = prepLayer.convertStrict(sharedLayerJson.parsed, context)
const validator = new ValidateLayer(knownImagePaths, sharedLayerJson.path, true);
const validator = new ValidateLayer(sharedLayerJson.path, true);
validator.convertStrict(fixed, context)
if (sharedLayers.has(fixed.id)) {
@ -200,7 +200,10 @@ class LayerOverviewUtils {
new PrevalidateTheme().convertStrict(themeFile, themePath)
themeFile = new PrepareTheme(convertState).convertStrict(themeFile, themePath)
new ValidateThemeAndLayers(knownImagePaths, themePath, true)
if(knownImagePaths === undefined){
throw "Could not load known images/licenses"
}
new ValidateThemeAndLayers(knownImagePaths, themePath, true, convertState.tagRenderings)
.convertStrict(themeFile, themePath)
this.writeTheme(themeFile)