Skip to content

Commit 24e24d5

Browse files
committed
Fix for codeblocks - example/test in playground
Signed-off-by: Dj Walker-Morgan <dj.walker-morgan@enterprisedb.com>
1 parent c6b14b5 commit 24e24d5

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

advocacy_docs/playground/1/01_examples/code-blocks.mdx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,13 @@ asdasd
3333
asdasd
3434
asdasdafasfa
3535
</pre>
36+
37+
```sql
38+
SELECT * FROM aidb.retrieve_text('test_knowledge_base', 'jacket', 2);
39+
__OUTPUT__
40+
key | value | distance
41+
-------+----------------------------------------------------+--------------------
42+
19337 | United Colors of Benetton Men Stripes Black Jacket | 0.2994317672742334
43+
55018 | Lakme 3 in 1 Orchid Aqua Shine Lip Color | 0.3804609668507203
44+
(2 rows)
45+
```

src/components/code-block.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ const splitChildrenIntoCodeAndOutput = (rawChildren) => {
2727
return [[], []];
2828
}
2929

30-
const splitRegex = /(?:\s+|^)__OUTPUT__\s*(?:\n+|$)/;
30+
// Simplified regex to split on the __OUTPUT__ marker
31+
const splitRegex = /\n__OUTPUT__\n/;
3132
const code = [];
3233
const output = [];
3334

0 commit comments

Comments
 (0)