mirror of
https://github.com/antokeinanen/obsidian-advanced-merger.git
synced 2026-07-22 07:40:24 +00:00
fix: correctly remove yaml and undo accidental class removal
This commit is contained in:
parent
8c5ba9d9e7
commit
18613da93e
2 changed files with 28 additions and 4 deletions
|
|
@ -150,10 +150,12 @@ export default class AdvancedMerge extends Plugin {
|
|||
);
|
||||
}
|
||||
|
||||
if (this.settings.removeYamlProperties) {
|
||||
sectionContents = sectionContents.replace(
|
||||
/^---\n(\w*:\s.*\n)*---/,
|
||||
/---\n(\w*:\s.*\n)*---/,
|
||||
"",
|
||||
);
|
||||
}
|
||||
|
||||
vault.append(outputFile, sectionContents);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -161,3 +161,25 @@ export const TRANSLATIONS: Record<string, Translation> = {
|
|||
"Видаляє властивості YAML із верхньої частини файлу під час об'єднання. УВАГА: Це може випадково видалити не-YAML частини.",
|
||||
},
|
||||
};
|
||||
|
||||
export class AdvancedMergeTranslation {
|
||||
private language: string;
|
||||
|
||||
/**
|
||||
* Represents a plugin translation.
|
||||
* @constructor
|
||||
*/
|
||||
constructor() {
|
||||
this.language = !Object.keys(TRANSLATIONS).contains(navigator.language)
|
||||
? DEFAULT_LANGUAGE
|
||||
: navigator.language;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets translation object for current language.
|
||||
* @returns {Translation} Current translation object.
|
||||
*/
|
||||
public get(): Translation {
|
||||
return TRANSLATIONS[this.language];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue