solo mostrar enlaces si se está en un bloque
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Cat /dev/Nulo 2023-04-18 19:27:26 -03:00
parent 076d661027
commit c98a5c8319

View file

@ -31,6 +31,10 @@
function getLinks(node) { function getLinks(node) {
/** @type {Link[]} */ /** @type {Link[]} */
let links = []; let links = [];
// a veces selecciona el documento entero y no queremos mostrar todos los enlaces
if (node.type.spec.group !== "block") return [];
let lastWasLinkMark = false; let lastWasLinkMark = false;
node.descendants((node) => { node.descendants((node) => {
for (const mark of node.marks) { for (const mark of node.marks) {