Skip to content

Commit

Permalink
feat: throw (#844)
Browse files Browse the repository at this point in the history
* feat: throw

* refactor
  • Loading branch information
kellyjosephprice authored Mar 28, 2024
1 parent 4dd3425 commit ecdba1b
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,14 @@ export const reactProcessor = (opts = {}) => {
};

export const compile = (text: string, opts = {}) => {
try {
const code = compileSync(text, {
return String(
compileSync(text, {
outputFormat: 'function-body',
providerImportSource: '@mdx-js/react',
remarkPlugins: [calloutTransformer],
...opts,
});

return code;
} catch (e) {
console.error(e);
return '';
}
}),
);
};

export const run = (code: string, opts = {}) => {
Expand Down

0 comments on commit ecdba1b

Please sign in to comment.