mirror of
https://github.com/dergigi/boris.git
synced 2025-12-19 23:54:23 +01:00
feat: initialize markr nostr bookmark client
- Add project structure with TypeScript, React, and Vite - Implement nostr authentication using browser extension (NIP-07) - Add NIP-51 compliant bookmark fetching and display - Create minimal UI with login and bookmark components - Integrate applesauce-core and applesauce-react libraries - Add responsive styling with dark/light mode support - Include comprehensive README with setup instructions This is a minimal MVP for a nostr bookmark client that allows users to view their bookmarks according to NIP-51 specification.
This commit is contained in:
84
node_modules/mdast-util-to-markdown/lib/util/container-flow.js
generated
vendored
Normal file
84
node_modules/mdast-util-to-markdown/lib/util/container-flow.js
generated
vendored
Normal file
@@ -0,0 +1,84 @@
|
||||
/**
|
||||
* @import {State} from 'mdast-util-to-markdown'
|
||||
* @import {FlowChildren, FlowParents, TrackFields} from '../types.js'
|
||||
*/
|
||||
|
||||
/**
|
||||
* @param {FlowParents} parent
|
||||
* Parent of flow nodes.
|
||||
* @param {State} state
|
||||
* Info passed around about the current state.
|
||||
* @param {TrackFields} info
|
||||
* Info on where we are in the document we are generating.
|
||||
* @returns {string}
|
||||
* Serialized children, joined by (blank) lines.
|
||||
*/
|
||||
export function containerFlow(parent, state, info) {
|
||||
const indexStack = state.indexStack
|
||||
const children = parent.children || []
|
||||
const tracker = state.createTracker(info)
|
||||
/** @type {Array<string>} */
|
||||
const results = []
|
||||
let index = -1
|
||||
|
||||
indexStack.push(-1)
|
||||
|
||||
while (++index < children.length) {
|
||||
const child = children[index]
|
||||
|
||||
indexStack[indexStack.length - 1] = index
|
||||
|
||||
results.push(
|
||||
tracker.move(
|
||||
state.handle(child, parent, state, {
|
||||
before: '\n',
|
||||
after: '\n',
|
||||
...tracker.current()
|
||||
})
|
||||
)
|
||||
)
|
||||
|
||||
if (child.type !== 'list') {
|
||||
state.bulletLastUsed = undefined
|
||||
}
|
||||
|
||||
if (index < children.length - 1) {
|
||||
results.push(
|
||||
tracker.move(between(child, children[index + 1], parent, state))
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
indexStack.pop()
|
||||
|
||||
return results.join('')
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {FlowChildren} left
|
||||
* @param {FlowChildren} right
|
||||
* @param {FlowParents} parent
|
||||
* @param {State} state
|
||||
* @returns {string}
|
||||
*/
|
||||
function between(left, right, parent, state) {
|
||||
let index = state.join.length
|
||||
|
||||
while (index--) {
|
||||
const result = state.join[index](left, right, parent, state)
|
||||
|
||||
if (result === true || result === 1) {
|
||||
break
|
||||
}
|
||||
|
||||
if (typeof result === 'number') {
|
||||
return '\n'.repeat(1 + result)
|
||||
}
|
||||
|
||||
if (result === false) {
|
||||
return '\n\n<!---->\n\n'
|
||||
}
|
||||
}
|
||||
|
||||
return '\n\n'
|
||||
}
|
||||
Reference in New Issue
Block a user