mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-21 10:16:44 +00:00
refactor(docs): use native MDX defaults
This commit is contained in:
@@ -169,15 +169,11 @@ function stripFrontmatter(raw) {
|
||||
}
|
||||
|
||||
function formatMdxError(filePath, error) {
|
||||
const place = error?.place ?? error?.position;
|
||||
const start = place?.start ?? place;
|
||||
const line = typeof start?.line === "number" ? start.line : undefined;
|
||||
const column = typeof start?.column === "number" ? start.column : undefined;
|
||||
return {
|
||||
type: "mdx",
|
||||
file: filePath,
|
||||
line,
|
||||
column,
|
||||
line: error?.line,
|
||||
column: error?.column,
|
||||
message: String(error?.reason ?? error?.message ?? error).split("\n")[0],
|
||||
};
|
||||
}
|
||||
@@ -230,14 +226,7 @@ async function checkMdxFile(filePath) {
|
||||
if (structureErrors.length > 0) {
|
||||
return structureErrors;
|
||||
}
|
||||
const value = stripFrontmatter(raw);
|
||||
await compile(
|
||||
{ path: filePath, value },
|
||||
{
|
||||
development: false,
|
||||
jsx: false,
|
||||
},
|
||||
);
|
||||
await compile({ path: filePath, value: stripFrontmatter(raw) });
|
||||
return [];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user