1
0
mirror of synced 2025-12-19 18:10:59 -05:00

Add Copilot prompt blocks and inline prompts (#57272)

Co-authored-by: Sarah Schneider <sarahs@github.com>
Co-authored-by: Sarah Schneider <sarahs@users.noreply.github.com>
This commit is contained in:
hubwriter
2025-09-10 09:14:13 +01:00
committed by GitHub
parent 60d6619820
commit 270fc3bf8e
11 changed files with 389 additions and 19 deletions

View File

@@ -4,6 +4,7 @@
// becomes...
// node.lang = javascript
// node.meta = { lineNumbers: 'left', copy: 'all', annotate: true }
// Also parse equals signs, where id=some-id becomes { id: 'some-id' }
import { visit } from 'unist-util-visit'
@@ -25,7 +26,7 @@ function strToObj(str) {
return Object.fromEntries(
str
.split(/\s+/g)
.map((k) => k.split(':'))
.map((k) => k.split(/[:=]/)) // split by colon or equals sign
.map(([k, ...v]) => [k, v.length ? v.join(':') : true]),
)
}