MCPcopy Create free account
hub / github.com/dailydotdev/apps / getStyleReplacement

Function getStyleReplacement

packages/shared/src/lib/markdown.ts:114–125  ·  view source on GitHub ↗
(wrapper: string)

Source from the content-addressed store, hash-verified

112};
113
114export const getStyleReplacement = (wrapper: string): GetReplacementFn => {
115 return (type: CursorType, { word, selection: [start] }) => {
116 const replacement = `${wrapper}${word}${wrapper}`;
117
118 if (type === CursorType.Isolated) {
119 const offset = start + wrapper.length;
120 return { replacement, offset: [offset, offset] };
121 }
122
123 return { replacement };
124 };
125};
126
127export const getMentionReplacement: GetReplacementFn = (
128 type,

Callers 1

onKeyDownFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected