diff --git a/src/convertors/markdown/markdown-convertor.test.ts b/src/convertors/markdown/markdown-convertor.test.ts index 1b554bc..6c6df47 100644 --- a/src/convertors/markdown/markdown-convertor.test.ts +++ b/src/convertors/markdown/markdown-convertor.test.ts @@ -33,9 +33,12 @@ describe('isDaily', () => { describe('id', () => { it('slugifies filename', async () => { const convertor = new MarkdownConvertor({graphId: '123'}) - const {notes} = await convertor.convert({data: '# foo', filename: 'foo wem.md'}) + const {notes} = await convertor.convert({ + data: '# Alex MacCaw', + filename: 'Alex MacCaw.md', + }) const [{id}] = notes - expect(id).toEqual('md-foo-wem') + expect(id).toEqual('alexmaccaw') }) }) diff --git a/src/convertors/markdown/markdown-helpers.ts b/src/convertors/markdown/markdown-helpers.ts index 4aad545..80a262b 100644 --- a/src/convertors/markdown/markdown-helpers.ts +++ b/src/convertors/markdown/markdown-helpers.ts @@ -17,7 +17,7 @@ export const dailyDateFromFilename = (filename: string): Date | undefined => { export const filenameToId = (filename: string) => { const basename = stripFileExtension(filename) - return `md-${slugify(basename)}` + return `${slugify(basename, {lowercase: true, decamelize: false, separator: ''})}` } export const filenameToSubject = (filename: string) => {