Skip to content

Commit

Permalink
fix: hidden files after sanitizing (#650)
Browse files Browse the repository at this point in the history
  • Loading branch information
akosbalasko authored Sep 10, 2024
1 parent f78b246 commit ea4bfb2
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/filename-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const applyCharacterMap = (title: string): string => {
export const normalizeFilenameString = (title: string) => {
// Allow setting a specific replacement character for file and resource names
// Default to a retrocompatible value
const normalizedTitle = sanitize(applyCharacterMap(title), {replacement: yarleOptions.replacementChar || '_'}).replace(/[\[\]\#\^]/g, '')
const normalizedTitle = sanitize(applyCharacterMap(title), {replacement: yarleOptions.replacementChar || '_'}).replace(/[\[\]\#\^]/g, '').replace(/^\./g, '');
console.log(normalizedTitle)
return normalizedTitle;
;
Expand Down
26 changes: 26 additions & 0 deletions test/yarle-special-cases.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,32 @@ dateFormat: undefined,
);

});


it.skip('Replacement settings', async () => {
const options: YarleOptions = {
dateFormat: undefined,
enexSources: [ `.${path.sep}test${path.sep}data${path.sep}export trial.enex` ],
outputDir: 'out',
outputFormat: OutputFormat.ObsidianMD,
convertPlainHtmlNewlines: true,
isMetadataNeeded: true,
globalReplacementSettings: [
{type:ReplaceType.title, regex:"\\[",replace:"_"},
{type:ReplaceType.title,regex:"\\]",replace:"_"},
{type:ReplaceType.title,regex:"^\\.",replace:""},
{type:ReplaceType.tag,regex:"^\\.",replace:""},
{type:ReplaceType.tag,regex:"\\.",replace:"_"}
],
replacementCharacterMap: {
"[": "",
"]": ""
}

};
await dropTheRopeRunner.run(options);
});

it('Encrypted lines in notes', async () => {
const options: YarleOptions = {
dateFormat: undefined,
Expand Down

0 comments on commit ea4bfb2

Please sign in to comment.