fix: copy button
This commit is contained in:
@@ -3,6 +3,13 @@ import MarkdownIt from 'markdown-it';
|
||||
import { EventSchema } from './event-schema';
|
||||
import type { EventData, EventMetadata } from '../types/event';
|
||||
|
||||
// gray-matter casts the source with Buffer.from() on every parse, and browsers have
|
||||
// no Buffer, so without this the client throws before the app mounts. The result is
|
||||
// only kept as an unused `orig` field, so a plain string stands in for it.
|
||||
if (typeof globalThis.Buffer === 'undefined') {
|
||||
(globalThis as { Buffer?: unknown }).Buffer = { from: (value: string) => value };
|
||||
}
|
||||
|
||||
const markdown = new MarkdownIt({ html: false, linkify: true, typographer: true });
|
||||
|
||||
export function parseEventSource(source: string, sourceName = 'event'): EventData {
|
||||
|
||||
Reference in New Issue
Block a user