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
feat(gatsby-remark-autolink-headers): Optionally specify header element types (#23366)
* Add elements prop to options that enables anchor generation for specified header tags only
* Update README to reflect addition of elements option
* Do not return markdownAST from node callback function in gatsby-remark-autolink-headers
* Fix Prettier format issues in gatsby-recipes README
exports[`gatsby-remark-autolink-headers adds places anchor after header when isIconAfterHeader prop is passed 1`] =`
254
321
Object {
255
322
"children": Array [
@@ -317,6 +384,84 @@ Object {
317
384
}
318
385
`;
319
386
387
+
exports[`gatsby-remark-autolink-headers does not add data to a markdown heading when elements prop is passed with no matching heading type 1`] =`
388
+
Object {
389
+
"children": Array [
390
+
Object {
391
+
"position": Position {
392
+
"end": Object {
393
+
"column": 14,
394
+
"line": 1,
395
+
"offset": 13,
396
+
},
397
+
"indent": Array [],
398
+
"start": Object {
399
+
"column": 3,
400
+
"line": 1,
401
+
"offset": 2,
402
+
},
403
+
},
404
+
"type": "text",
405
+
"value": "Heading Uno",
406
+
},
407
+
],
408
+
"depth": 1,
409
+
"position": Position {
410
+
"end": Object {
411
+
"column": 14,
412
+
"line": 1,
413
+
"offset": 13,
414
+
},
415
+
"indent": Array [],
416
+
"start": Object {
417
+
"column": 1,
418
+
"line": 1,
419
+
"offset": 0,
420
+
},
421
+
},
422
+
"type": "heading",
423
+
}
424
+
`;
425
+
426
+
exports[`gatsby-remark-autolink-headers does not add data to a markdown heading with custom id when elements prop is passed with no matching heading type 1`] =`
427
+
Object {
428
+
"children": Array [
429
+
Object {
430
+
"position": Position {
431
+
"end": Object {
432
+
"column": 27,
433
+
"line": 1,
434
+
"offset": 26,
435
+
},
436
+
"indent": Array [],
437
+
"start": Object {
438
+
"column": 3,
439
+
"line": 1,
440
+
"offset": 2,
441
+
},
442
+
},
443
+
"type": "text",
444
+
"value": "Heading Uno {#custom_h1}",
445
+
},
446
+
],
447
+
"depth": 1,
448
+
"position": Position {
449
+
"end": Object {
450
+
"column": 27,
451
+
"line": 1,
452
+
"offset": 26,
453
+
},
454
+
"indent": Array [],
455
+
"start": Object {
456
+
"column": 1,
457
+
"line": 1,
458
+
"offset": 0,
459
+
},
460
+
},
461
+
"type": "heading",
462
+
}
463
+
`;
464
+
320
465
exports[`gatsby-remark-autolink-headers maintain case of markdown header for id 1`] =`
0 commit comments