From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/32331 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Albert Krewinkel Newsgroups: gmane.text.pandoc Subject: Re: help filtering links Date: Mon, 13 Mar 2023 14:13:43 +0100 Message-ID: <878rg07pwn.fsf@zeitkraut.de> References: Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16632"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBCZJF7XJTILRBIGEXSQAMGQEBG3WRTI-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mon Mar 13 14:16:20 2023 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-wr1-f61.google.com ([209.85.221.61]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pbi2F-00045p-Vx for gtp-pandoc-discuss@m.gmane-mx.org; Mon, 13 Mar 2023 14:16:19 +0100 Original-Received: by mail-wr1-f61.google.com with SMTP id d14-20020adfa34e000000b002bfc062eaa8sf2124957wrb.20 for ; Mon, 13 Mar 2023 06:16:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1678713379; cv=pass; d=google.com; s=arc-20160816; b=Mi3XHiqtV0c4hscgQU4cgtHI/xNDhNU6KFzFrm+t6aN7Y1MdfzxVK4pPntUkWkWX4R q8yuTNbh+MpjU/7MLb0Iaw8NvLO4+kz92u4Kbb1Spu3ol23ZFMFRGPTuAl0jzJtBzXMN Nil9br6LELoQQzHr35t8wXSxF3f8sUD0Qw1aklR7/Ku3jEH9hJpyrt1O69ax2VnRSkrg Z2NE9PewxbZK3wxxFn8X0OZju7voDMkpzztltkM4s9jVSBo9MFzfS/5qIMRphxDIB+Ok u1YV2JARaxCEqXaeJkAXRvuMgRYpWCwir69F1CVj+aQoagg6jSn5+9uC/itaZc9fN952 DSWw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:content-transfer-encoding :mime-version:message-id:in-reply-to:date:subject:to:from:references :sender:dkim-signature; bh=ZeSAoYUdXlJsWxGBs/oRx9C6uEPBSk9k+4PPSiceBws=; b=eEtLlF+07j93hwhGiv9dzA7UY0U2QVRnRW5uDih91bVuQScJZ/OxME448k0qojLzdc QJvaOOQRrmkDcmq9LZxCWSRBvLMaEHovUa3B3MaCAdQVYmc2eyax3xmKm8Q5gDtCaCpx YoDvBGzKfndyqtxdMIU685z9FaMjo5kYq/k1GAO5OfHZ7q4avO6cF8kTv91YRB6ayZ+2 DEzt2wBh08XXeBW6E02OL9VmV9ffW/P9wvAWzVIp7ScVYIafB2m2yRYUvZk30zgxXcuy teL8EuoFXUArkoLG6neqfCI76BdABIZjrWEmvn5Rn01odq+vhwx31eKvNwK9edR1XuLI nZvA== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org designates 80.241.56.172 as permitted sender) smtp.mailfrom=albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; t=1678713379; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender :content-transfer-encoding:mime-version:message-id:in-reply-to:date :subject:to:from:references:sender:from:to:cc:subject:date :message-id:reply-to; bh=ZeSAoYUdXlJsWxGBs/oRx9C6uEPBSk9k+4PPSiceBws=; b=AIQrRmXc6Uuq6NAzIGAk15yQ+wfXjPDlIzDYzifJUpLfdEl/0f0rwuO9DVYZeCw7ic NNe3ffHnyx1RsCBgFyD+l6IeneH9FBQCluyE/pl0VCvRzsTdAJ4vuXx2JklZNk/ewF3X YZxUaELSTIyuczSrx6sPbjnQQ4jdyPWXL+9AcSlvZww4D2da84HXwgzRsbrSszP4/s5c STazJ3fOTbMWORsEJZPDivBAZu0PEdSaAjGHdaePg6ns/YpbBrsPxw4XN+VUEkrnuwtq j6AHbX9+Q818HFM5wi12y03lODaPDODZDDO33uw32VOLjLk9slG X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678713379; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender :content-transfer-encoding:mime-version:message-id:in-reply-to:date :subject:to:from:references:x-gm-message-state:sender:from:to:cc :subject:date:message-id:reply-to; bh=ZeSAoYUdXlJsWxGBs/oRx9C6uEPBSk9k+4PPSiceBws=; b=T3YsJytLVCm8pNfXUiYf8fDSrGubSugJLdl+9vtr6qkPi9LtSzLDhOu/j1rlw5GhSh pt2FeHmcbLhzR3Ajo+WpRFKuNFzIChr0iNCcRcsRx5FPXBBthLwT3MNc+yNzRjrcEcE+ XmOHvFan2+R38NcVbv/D7T5cl7Bfl0V1TZBpixQWISW5gLek7rAuk5FZjQCuLWA/I+7p YDAPX5lS7Rk8xDyhcaEkZ5jHpcWcDVFaAPsfIxTY7Blsx7WF+JDiT1ZYSUbx03ycdl3d EseWgL Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AO0yUKU2wx2YOV/gDIiJnpuNOHRxGAjP5QkhXYJi91iClc8t9JCihvBW LVkiqsmETxafM/0hlu0TAGQ= X-Google-Smtp-Source: AK7set+Az9uqvQGoJuiGJ9iH8WJePCWoN9O2eADe6Xcc3l8Nhx1EzYoGPrW648yAdi23vsJNv1vZUg== X-Received: by 2002:adf:e30b:0:b0:2c7:1483:ce01 with SMTP id b11-20020adfe30b000000b002c71483ce01mr6533141wrj.0.1678713379495; Mon, 13 Mar 2023 06:16:19 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:600c:3c8e:b0:3cf:9be3:73dd with SMTP id bg14-20020a05600c3c8e00b003cf9be373ddls8337505wmb.3.-pod-canary-gmail; Mon, 13 Mar 2023 06:16:14 -0700 (PDT) X-Received: by 2002:a05:600c:4509:b0:3ed:29f7:5b43 with SMTP id t9-20020a05600c450900b003ed29f75b43mr417245wmo.27.1678713374224; Mon, 13 Mar 2023 06:16:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1678713374; cv=none; d=google.com; s=arc-20160816; b=HC6ZothZejsvDQNGTBGEAslRpoynC0BKOMota9VHPffIjZrBmXAvzqH0wK57eRsJNG md8TwNjWR/gbHhBXmOfwmsFN9resB8hrbfR0ILCKKyaBKbRT2YlCn9+wihEeHh2CwcrX bGAqr0Pw/00moRe9FRqLD9sZ3aDqAck8ryBUoIKsKnuqIDj5M3dBIDnpNz/CD4MHSYgE cjtPvcJodIfmzHrfvbClVy2T2ZGDUVDJcLmVJTMehEun9iaaFKWjH8H8Aj5eG55AupPy plCR1pRL68Sqz7WQPJ2qUCA6yC3VPFbM4af+ZXEG5xVkek/neDp+SlSZh6QEexlAgDWF dzfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:in-reply-to:date :subject:to:from:references; bh=AAoSbbPl0kw3dU2iuoBouN3Yp2T/d0iulUWOGOSG0is=; b=y//7cmuqA2ALynLWzc/0h6L4a0oXxo+y3s6uw6TFtSaedvOWGzX/d1mOd/0DjBQru7 vWMyCpM1cdcK9z/RRK8jJ0wKam6V3Pop91eOLmwtZg5CzcXPDPLpn41Tf8OXU+A5ODE9 KARkLdm7dYxSfHiHypzOWo9jzZPgU5fKmZNK4Jtq0zHD2YlaUvYmK7UxnWpEi8tGxGYg aWC5ScpF//Qdnu5DjBnrHFnOnYr0qENOsWXr1cYP8oVONSwwl3KQZYbyOnsg6v4RclYW 6TPycL3IghtoHWEo/qIRPG2SqOi/U99+mazTiJirp+QL5wCbvWYANQ3Sh+e90POqaAWH EUFQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org designates 80.241.56.172 as permitted sender) smtp.mailfrom=albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org Original-Received: from mout-p-202.mailbox.org (mout-p-202.mailbox.org. [80.241.56.172]) by gmr-mx.google.com with ESMTPS id fk13-20020a05600c0ccd00b003ed29f3d6d3si23359wmb.1.2023.03.13.06.16.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Mar 2023 06:16:14 -0700 (PDT) Received-SPF: pass (google.com: domain of albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org designates 80.241.56.172 as permitted sender) client-ip=80.241.56.172; Original-Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:b231:465::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-202.mailbox.org (Postfix) with ESMTPS id 4PZxxR4P9gz9sZv for ; Mon, 13 Mar 2023 14:16:11 +0100 (CET) In-reply-to: X-Rspamd-Queue-Id: 4PZxxR4P9gz9sZv X-Original-Sender: albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org designates 80.241.56.172 as permitted sender) smtp.mailfrom=albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org Precedence: list Mailing-list: list pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org; contact pandoc-discuss+owners-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org List-ID: X-Google-Group-Id: 1007024079513 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Xref: news.gmane.io gmane.text.pandoc:32331 Archived-At: Pablo Rodr=C3=ADguez writes: > Dear list, > > I want to start to move from Markdown to CommonMark (extended for pandoc)= . > > I would like to be able to format three types of links, such as in: > > ``` > # intro > > as said in [intro] > > > > [this is another link](https://another.link) > ``` > > The first one would be an internal section link, the second one would be > an autogenerated link. > > I think that a Lua filter could help to add a "section-link" class to > the first kind of link and an "auto-link" class to the second kind of lin= k. See the filter below. It adds a `section-link` class for the first kind. Pandoc already adds a `uri` class for the second type, so those are not touched by the filter. Cheers, Albert local headers =3D {} local function collect_ids (h) if h.identifier ~=3D '' then headers[h.identifier] =3D true end end local function add_classes (link) local id =3D link.target:match '^%#(.*)' if id and headers[id] then link.classes:insert 'section-link' return link end end return { { Header =3D collect_ids }, { Link =3D add_classes } } --=20 Albert Krewinkel GPG: 8eed e3e2 e8c5 6f18 81fe e836 388d c0b2 1f63 1124 --=20 You received this message because you are subscribed to the Google Groups "= pandoc-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an e= mail to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/= pandoc-discuss/878rg07pwn.fsf%40zeitkraut.de.