Jacky Zhao
2023-08-09 e4950e06a15e34134b9feb064749748080bd59a1
fix getFileExtension missing numeric extensions (e.g. mp4)
3 files modified
7 ■■■■■ changed files
quartz/components/ContentMeta.tsx 4 ●●● patch | view | raw | blame | history
quartz/path.test.ts 1 ●●●● patch | view | raw | blame | history
quartz/path.ts 2 ●●● patch | view | raw | blame | history
quartz/components/ContentMeta.tsx
@@ -13,9 +13,7 @@
      }
      segments.push(timeTaken)
      return (
        <p class="content-meta">{segments.join(", ")}</p>
      )
      return <p class="content-meta">{segments.join(", ")}</p>
    } else {
      return null
    }
quartz/path.test.ts
@@ -145,6 +145,7 @@
        ["/content/index.md", "content/index"],
        ["content/cool.png", "content/cool"],
        ["index.md", "index"],
        ["test.mp4", "test"],
        ["note with spaces.md", "note-with-spaces"],
      ],
      path.slugifyFilePath,
quartz/path.ts
@@ -221,7 +221,7 @@
}
function _getFileExtension(s: string): string | undefined {
  return s.match(/\.[A-Za-z]+$/)?.[0]
  return s.match(/\.[A-Za-z0-9]+$/)?.[0]
}
function _isRelativeSegment(s: string): boolean {