From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/23223 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Albert Krewinkel Newsgroups: gmane.text.pandoc Subject: Re: Replace Str with HTML in Lua Filter Date: Sat, 10 Aug 2019 18:02:30 +0200 Message-ID: <8736i9qa95.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: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="129944"; mail-complaints-to="usenet@blaine.gmane.org" To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBCZJF7XJTILRBHWVXPVAKGQEAPKTUPQ-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Sat Aug 10 18:02:39 2019 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-wm1-f61.google.com ([209.85.128.61]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1hwTpH-000Xhu-Eg for gtp-pandoc-discuss@m.gmane.org; Sat, 10 Aug 2019 18:02:39 +0200 Original-Received: by mail-wm1-f61.google.com with SMTP id t62sf3075996wmt.1 for ; Sat, 10 Aug 2019 09:02:39 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1565452959; cv=pass; d=google.com; s=arc-20160816; b=ME5Kj/ERKAsRoCCy+rvv0L4TOpgzUa9Dgx3aHuzkEPR0RcdlkXmg9eaCqhDZcUlXUM rdX5XXlOVY95ywmIx3vhw8gtMOdZefmSRoItbjSFEt0E5HZkg3gtU/VtTWlfaKRU1bIV uuM/gFB7nwQGKPW1VN4NythTUKbayptbk6smEevzeMgVgOFurF7i4L48jNt7ZqsdN3xj RUJek0lwM/RjBPtim9D4V+GAMLHNJLKb+98eAZqQqR+kzxtq2wm5SSRUAufu5uDc5Ire 5dIkdt6kkdjEu+MUsSNK4jIRXSuJ2WvcrNqVEYtkrbNXF2drWUP7NcKygPgeeaJd2Q6A TiJw== 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:date:in-reply-to:subject:to:from:references :sender:dkim-signature; bh=0E+JIbdOFPuec7ynvubX/1Ldg6u9Mnn15LunBqdK4TE=; b=Sr+v5PrEPO4m43bWPta2KWmf3jFqLZyJl1xx7ropto/2GNlVyzvGCuCUkDG8HUQ3cg 5LljdELaDFMDEtyEOk12agoUKlq/2zR+0JqD3UmxrQQiD3cA71m3d6GdCxaJocsZtUGP TspVP4vM6lBr4+A2HGCsMGBclRjPYdNyrb2caxiDgI4jVl9xYoVlshrw8in5ynme+4B7 H514Hgre7/Dv2j9bqlNvnXCXwrDESNiBMdSZ1SqECevS14uHkftVwV5I8V6mVYl6t3+X 93iQaSv9rc7Uzn4n0JCgVU9KRGTf0Z2PSNHTDi/hfYPsLCpGD/y8CUHG/d+jGV7gKj6q b0rw== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org designates 2001:67c:2050:104:0:2:25:2 as permitted sender) smtp.mailfrom=albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeitkraut.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:references:from:to:subject:in-reply-to:date:message-id :mime-version:content-transfer-encoding:x-original-sender :x-original-authentication-results:reply-to:precedence:mailing-list :list-id:list-post:list-help:list-archive:list-subscribe :list-unsubscribe; bh=0E+JIbdOFPuec7ynvubX/1Ldg6u9Mnn15LunBqdK4TE=; b=syTAmGB6H1Xhdylb6FwT8O7o3g9MinjzpfqMlrMdrhX22qQbIhGbL/wPbCA+FRCKsM fgCDByBskVA0MOEhARWTuRB9n/XsixVqqcK6lNyxSD1ERUMkRerPbQQcVa4XK5yw/ISj t8/4jhijGbdR0JQSWzd/L23bgqaeLPf5rn/92l0I1F6AFISgNkNcgDrHygHfmlGmnLbN Xwpbzd+o9aBGNA1D94gdK/lieW3rxjZV4egGgrzE2DenEhDuowMlPzD3oXIrn7HRaaTM 9ukbqBvVtaqZRGve9yvbCl8EA3j4+lI0x6fpczwGO1gA/ayOs774EkCjkiuW4zkz0xc7 SB1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:references:from:to:subject:in-reply-to :date:message-id:mime-version:content-transfer-encoding :x-original-sender:x-original-authentication-results:reply-to :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post :list-help:list-archive:list-subscribe:list-unsubscribe; bh=0E+JIbdOFPuec7ynvubX/1Ldg6u9Mnn15LunBqdK4TE=; b=rLftyYUsv3DJV+mWyeo47VCvzrLA35NmwJJK3mgj26F9OmfhlLD3Jnnj/IKKHVa7UT nUdoCwuLBrNtQv6TpdjRRcOf+LVsCBwm/EhY3wSobrIlBWJga1jFEXSYZdsXLQYZ3MJB Cokb2egO7ojdstA3n2mvngeuuLGqYU4WzST3gqPvSGQ8tYFwjd9ZcY2IWcPy0JX5/aJD TEKpjUZvlM8O5yPs/VpQNzvSbBoWN/AKH4nEyP8PRYZba+7KhsPF2civGJ3BJIdyNSJD 4lgTyHBEYGuXooyaxrHBzAzvAHd5bH518WGDY1HHTHpKpbP3gn95VS2ULtzP7oCvnxRZ Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: APjAAAXGK1+oeD0p1YAHazBS7K2fq9qeMpBF9+Bee4GOpITRn0RuB2M7 QR/n9boMyk5CnB16LVquTOA= X-Google-Smtp-Source: APXvYqwlpPGmhkbOQagsDLs2hDXVtSfPjazdZzg83/XTAh+RcbmKL3TjPvv1pmPp+FTskQrU4JFZjg== X-Received: by 2002:a05:600c:144:: with SMTP id w4mr3532426wmm.94.1565452958941; Sat, 10 Aug 2019 09:02:38 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:adf:bac4:: with SMTP id w4ls29154404wrg.13.gmail; Sat, 10 Aug 2019 09:02:37 -0700 (PDT) X-Received: by 2002:a5d:4041:: with SMTP id w1mr31206342wrp.199.1565452957818; Sat, 10 Aug 2019 09:02:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565452957; cv=none; d=google.com; s=arc-20160816; b=rRNCVCHCYscOkL9xFJs8SEsWE9asz529n2JyVmf5us707RGLEFCSkzAJb7KtjtxjgF v4t1WO4XY1sKhr2TU5W7GCKLYsdzkiKrTTuwUHnLr6t699/76opy5uL/o6OUmR1I3XnZ bujMNR753UmQUbVCbZ3VTXBLTmLm8gLGQSGhyTEarQj7FBycwkzsoxRCkbtyo40JtyMz TzQfbaa/hB8CsTz2gxPORB85159gdV7ian/ULLQoM/JnwiJ23sRmSWo/5wXWn2V9Yvtt 7CfZew+Kqf5p7RBTm0Z0cl2/JG+HfoYpfmJj20d3xzzMCFlB3dxofWuAfyqpT9csaUdw YK4w== 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:date:in-reply-to :subject:to:from:references; bh=qmUIwQAu4G/IUbBXIq3HILMxRH6/TMuP0BDPrg825Zc=; b=CaMg/S7JuwfiX08ls4YYBsGHapyM3/vsrV6d+gvvExjaMUfM4YYl//CfZK+cKsvdwJ eLC0mE4HEcYFAYdlCM/exZKE23gwerptlXI8xDDhvR/MdVOJrr9Bdq/t3Y4yXh7c31UM Utgm05QPU8ZsmBYqw04a2PM25xwrkycaIksij4pJYgPMEasrv9AmQ5YPAOHyKPq4+fHW Qz1dNq7P1ChWo1846xm1cavkOAAolFerurCuGWznnndLGx+sRHjx5EmrEDO8a1KxK/qN unPkUlBN+7nRRSUUGoJszH/a9KDcRZC79J00BhbAfkL3Gs3u0+fzZ4/dmmxnI7E3gw3U 5yIQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org designates 2001:67c:2050:104:0:2:25:2 as permitted sender) smtp.mailfrom=albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeitkraut.de Original-Received: from mx2.mailbox.org (mx2a.mailbox.org. [2001:67c:2050:104:0:2:25:2]) by gmr-mx.google.com with ESMTPS id z24si397451wml.0.2019.08.10.09.02.37 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 10 Aug 2019 09:02:37 -0700 (PDT) Received-SPF: pass (google.com: domain of albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org designates 2001:67c:2050:104:0:2:25:2 as permitted sender) client-ip=2001:67c:2050:104:0:2:25:2; Original-Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:105:465:1:2:0]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mx2.mailbox.org (Postfix) with ESMTPS id 82790A1373 for ; Sat, 10 Aug 2019 18:02:37 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Original-Received: from smtp2.mailbox.org ([80.241.60.241]) by spamfilter06.heinlein-hosting.de (spamfilter06.heinlein-hosting.de [80.241.56.125]) (amavisd-new, port 10030) with ESMTP id u1sS3D_6Fp4Q for ; Sat, 10 Aug 2019 18:02:31 +0200 (CEST) In-reply-to: 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 2001:67c:2050:104:0:2:25:2 as permitted sender) smtp.mailfrom=albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeitkraut.de 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.org gmane.text.pandoc:23223 Archived-At: Ken Dow writes: > My DOCX source document, which is being converted to HTML, uses some Goog= le > Material fonts. What shows up in the AST are values like > > Str "\8211" > > I'd like to find and replace those to produce something like the followin= g > HTML: > > face > > Is that possible and if so, how? The way to go here is via `RawInline` elements, e.g.: function Str (s) if s.text =3D=3D '=E2=80=93' then return pandoc.RawInline( 'html', 'face' ) end end Note matching on an exact string would fail if the character was somewhere within a word (a typical would be em-dashes). One would have to use the [utf8.codes] module to manually find and replace those characters in that case. [utf8.codes](https://www.lua.org/manual/5.3/manual.html#pdf-utf8.codes) -- 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/8736i9qa95.fsf%40zeitkraut.de.