mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 21:05:19 +00:00
feat(server): add real-world prompt test for copilot apis (#8629)
fix AF-1432, PD-1176
This commit is contained in:
25
tools/copilot-result/markdown.js
Normal file
25
tools/copilot-result/markdown.js
Normal file
@@ -0,0 +1,25 @@
|
||||
import { jsxslack } from 'jsx-slack';
|
||||
import { marked, Renderer } from 'marked';
|
||||
|
||||
export const render = markdown => {
|
||||
const rendered = marked(markdown, {
|
||||
renderer: new (class CustomRenderer extends Renderer {
|
||||
heading({ tokens }) {
|
||||
return `
|
||||
<Fragment>
|
||||
<Section><b>${tokens[0].text}</b></Section>
|
||||
<Divider />
|
||||
</Fragment>`;
|
||||
}
|
||||
|
||||
list(token) {
|
||||
return `<Section>${super.list(token)}</Section>`;
|
||||
}
|
||||
|
||||
hr() {
|
||||
return `<Divider />`;
|
||||
}
|
||||
})(),
|
||||
});
|
||||
return jsxslack([`<Blocks>${rendered}</Blocks>`]);
|
||||
};
|
||||
Reference in New Issue
Block a user