Skip to content

Commit

Permalink
polish before merge
Browse files Browse the repository at this point in the history
  • Loading branch information
slorber committed May 24, 2024
1 parent 98e393f commit ebe2aef
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ export type ResolveMarkdownLink = (
params: ResolveMarkdownLinkParams,
) => string | null;

// TODO: this plugin shouldn't be in the core MDX loader
// After we allow plugins to provide Remark/Rehype plugins (see
// https://github.com/facebook/docusaurus/issues/6370), this should be provided
// by theme-mermaid itself
export interface PluginOptions {
resolveMarkdownLink: ResolveMarkdownLink;
}
Expand Down
4 changes: 0 additions & 4 deletions packages/docusaurus-plugin-content-docs/src/versions/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -278,10 +278,6 @@ export function getVersionFromSourceFilePath(
filePath.startsWith(docsDirPath),
),
);
// At this point, this should never happen, because the MDX loaders' paths are
// literally using the version content paths; but if we allow sourcing content
// from outside the docs directory (through the `include` option, for example;
// is there a compelling use-case?), this would actually be testable
if (!versionFound) {
throw new Error(
`Unexpected error: file at "${filePath}" does not belong to any docs version!`,
Expand Down
3 changes: 3 additions & 0 deletions packages/docusaurus-utils/src/markdownLinks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ export type BrokenMarkdownLink<T extends ContentPaths> = {
link: string;
};

// Note this is historical logic extracted during a 2024 refactor
// The algo has been kept exactly as before for retro compatibility
// See also https://github.com/facebook/docusaurus/pull/10168
export function resolveMarkdownLinkPathname(
linkPathname: string,
context: {
Expand Down

0 comments on commit ebe2aef

Please sign in to comment.