Emdash source with visual editor image upload fix
Fixes: 1. media.ts: wrap placeholder generation in try-catch 2. toolbar.ts: check r.ok, display error message in popover
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
import type { ArbitraryTypedObject } from "@portabletext/types";
|
||||
|
||||
import type { ContentfulEntry } from "../types.js";
|
||||
|
||||
export function transformCodeBlock(entry: ContentfulEntry, key: string): ArbitraryTypedObject {
|
||||
return {
|
||||
_type: "code",
|
||||
_key: key,
|
||||
code: (entry.fields.code as string) ?? "",
|
||||
language: (entry.fields.language as string) ?? "",
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user