Skip to content

Commit

Permalink
add nostr: prefix to all nostr entities using nostr-editor (#491)
Browse files Browse the repository at this point in the history
  • Loading branch information
ticruz38 authored Nov 26, 2024
1 parent 56184fd commit f990206
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/app/editor/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ export const getEditorOptions = ({
Bolt11Extension.extend(asInline({addNodeView: () => SvelteNodeViewRenderer(EditBolt11)})),
NProfileExtension.extend({
addNodeView: () => SvelteNodeViewRenderer(EditMention),
renderText: props => "nostr:" + props.node.attrs.nprofile,
addProseMirrorPlugins() {
return [
createSuggestions({
Expand All @@ -127,8 +128,18 @@ export const getEditorOptions = ({
]
},
}),
NEventExtension.extend(asInline({addNodeView: () => SvelteNodeViewRenderer(EditEvent)})),
NAddrExtension.extend(asInline({addNodeView: () => SvelteNodeViewRenderer(EditEvent)})),
NEventExtension.extend(
asInline({
addNodeView: () => SvelteNodeViewRenderer(EditEvent),
renderText: props => "nostr:" + props.node.attrs.nevent,
}),
),
NAddrExtension.extend(
asInline({
addNodeView: () => SvelteNodeViewRenderer(EditEvent),
renderText: props => "nostr:" + props.node.attrs.naddr,
}),
),
ImageExtension.extend(
asInline({addNodeView: () => SvelteNodeViewRenderer(EditMedia)}),
).configure({defaultUploadUrl, defaultUploadType: uploadType}),
Expand Down

0 comments on commit f990206

Please sign in to comment.