Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

Handle empty code block

Terry Sutton50c426dc5a19
diff --git a/apps/docs/components/CodeBlock/CodeBlock.tsx b/apps/docs/components/CodeBlock/CodeBlock.tsx
index eb6ed7a5640..b54e01b699f 100644
--- a/apps/docs/components/CodeBlock/CodeBlock.tsx
+++ b/apps/docs/components/CodeBlock/CodeBlock.tsx
@@ -55,7 +55,7 @@ const CodeBlock: FC<Props> = ({
const singleString = typeof singleChild === 'string' ? singleChild : undefined
let codeValue = value ?? singleString ?? children
- codeValue = codeValue.trimEnd?.() ?? codeValue
+ codeValue = codeValue?.trimEnd?.() ?? codeValue
// check the length of the string inside the <code> tag
// if it's fewer than 70 characters, add a white-space: pre so it doesn't wrap
@@ -136,7 +136,7 @@ const CodeBlock: FC<Props> = ({
`${!title ? 'top-2' : 'top-[3.25rem]'}`,
].join(' ')}
>
- {/* //
+ {/* //
@ts-ignore */}
<CopyToClipboard text={value || children}>
<Button
diff --git a/apps/docs/pages/guides/cli/local-development.mdx b/apps/docs/pages/guides/cli/local-development.mdx
index 42bee86356c..183f670dd1c 100644
--- a/apps/docs/pages/guides/cli/local-development.mdx
+++ b/apps/docs/pages/guides/cli/local-development.mdx
@@ -151,10 +151,11 @@ Database changes are managed through "migrations." Database migrations are a com
For this guide, create a table called `employees`. In Supabase Studio, navigate to the **SQL Editor** page and run the following SQL command:
```sql
-create table employees (
- id integer primary key generated always as identity,
- name text
-);
+create table
+ employees (
+ id integer primary key generated always as identity,
+ name text
+ );
```
<Admonition type="note">
@@ -176,8 +177,9 @@ This creates a new migration named `supabase/migrations/<timestamp>_create_emplo
Use the seed script in `supabase/seed.sql` (created with [`supabase init`](/docs/reference/cli/usage#supabase-init)) to add sample data to the table.
```sql
--- in supabase/seed.sql
-insert into public.employees (name)
+ -- in supabase/seed.sql
+insert into
+ public.employees (name)
values
('Erlich Bachman'),
('Richard Hendricks'),
@@ -197,9 +199,9 @@ You should now see the contents of `employees` in Studio.
Use the [`reset`](/docs/reference/cli/usage#supabase-db-reset) command to revert any changes to the local database.
```sql
--- run on local database to make a change
-alter table employees
- add department text default 'Hooli';
+ -- run on local database to make a change
+alter table
+ employees add department text default 'Hooli';
```
Run the following command to reset the local database:
@@ -257,10 +259,6 @@ The local development environment is not as feature-complete as the Supabase Pla
- Logs are not supported through the interface (however you can access them through the Docker containers).
- You cannot update your project settings in the Dashboard—this must be done using the CLI.
-```
-
-```
-
export const Page = ({ children }) => <Layout meta={meta} children={children} />
export default Page