You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: try to update citations starting points when a code block is present (#731)
* fix: try to update citations start and end points when there is a code block present
* fix: decoding data before to generate file
* fix: multiple blocks with multi citations
test('should fix citations position for to get the correct markdown',()=>{
221
+
constcitations=[
222
+
{
223
+
text: '(fn',
224
+
start: 71,
225
+
end: 74,
226
+
document_ids: ['12345'],
227
+
},
228
+
{
229
+
text: 'delay',
230
+
start: 76,
231
+
end: 81,
232
+
document_ids: ['12345'],
233
+
},
234
+
{
235
+
text: 'let debounceTimer',
236
+
start: 86,
237
+
end: 103,
238
+
document_ids: ['12345'],
239
+
},
240
+
{
241
+
text: 'return function',
242
+
start: 107,
243
+
end: 122,
244
+
document_ids: ['12345'],
245
+
},
246
+
{
247
+
text: 'args',
248
+
start: 126,
249
+
end: 130,
250
+
document_ids: ['12345'],
251
+
},
252
+
{
253
+
text: 'clearTimeout',
254
+
start: 135,
255
+
end: 147,
256
+
document_ids: ['12345'],
257
+
},
258
+
{
259
+
text: '(debounceTimer',
260
+
start: 147,
261
+
end: 161,
262
+
document_ids: ['12345'],
263
+
},
264
+
{
265
+
text: 'debounceTimer = setTimeout',
266
+
start: 165,
267
+
end: 191,
268
+
document_ids: ['12345'],
269
+
},
270
+
{
271
+
text: 'fn.apply(this, args',
272
+
start: 201,
273
+
end: 220,
274
+
document_ids: ['12345'],
275
+
},
276
+
{
277
+
text: 'delay',
278
+
start: 227,
279
+
end: 232,
280
+
document_ids: ['12345'],
281
+
},
282
+
{
283
+
text: 'code is only executed once per user input',
284
+
start: 285,
285
+
end: 326,
286
+
document_ids: ['12345'],
287
+
},
288
+
{
289
+
text: 'takes two parameters',
290
+
start: 331,
291
+
end: 351,
292
+
document_ids: ['12345'],
293
+
},
294
+
{
295
+
text: 'the function to be debounced',
296
+
start: 353,
297
+
end: 381,
298
+
document_ids: ['12345'],
299
+
},
300
+
{
301
+
text: 'the delay in milliseconds',
302
+
start: 386,
303
+
end: 411,
304
+
document_ids: ['12345'],
305
+
},
306
+
];
307
+
consttext=
308
+
"Here's a JavaScript debounce function: ```javascript function debounce(fn, delay) { let debounceTimer; return function(...args) { clearTimeout(debounceTimer); debounceTimer = setTimeout(() => { fn.apply(this, args); }, delay); }; } ``` The debounce function ensures that the code is only executed once per user input. It takes two parameters: the function to be debounced and the delay in milliseconds.";
0 commit comments