normalizeMarkdownPath = pathname => {
  const isDir = isDirectory2(pathname)
  if (isDir || isMarkdownFile(pathname)) {
    // Normalize and resolve the path or link target.
    const resolved = normalizeAndResolvePath(pathname)
    if (resolved) {
      return { isDir, path: resolved }
    } else {
      console.error(`[ERROR] Cannot resolve "${pathname}".`)
    }
  }
  return null
}
Special function to normalize directory and markdown file paths.

@param {string} pathname The path to the file or directory.
@returns {{isDir: boolean, path: string}?} Returns the normalize path and a
directory hint or null if it's not a directory or markdown file.