From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id QCEnMS6MD2K/OQEAgWs5BA (envelope-from ) for ; Fri, 18 Feb 2022 13:08:14 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id mLTAKS6MD2JPXQAAG6o9tA (envelope-from ) for ; Fri, 18 Feb 2022 13:08:14 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 4CC222AF53 for ; Fri, 18 Feb 2022 13:08:14 +0100 (CET) Received: from localhost ([::1]:40732 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nL23Z-0003rr-5g for larch@yhetil.org; Fri, 18 Feb 2022 07:08:13 -0500 Received: from eggs.gnu.org ([209.51.188.92]:38902) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nL22B-0003nz-EZ for emacs-orgmode@gnu.org; Fri, 18 Feb 2022 07:06:50 -0500 Received: from ciao.gmane.io ([116.202.254.214]:33676) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nL229-0003cq-NZ for emacs-orgmode@gnu.org; Fri, 18 Feb 2022 07:06:47 -0500 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1nL227-00030B-E1 for emacs-orgmode@gnu.org; Fri, 18 Feb 2022 13:06:43 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: emacs-orgmode@gnu.org From: Max Nikulin Subject: Re: Pandoc and nested emhases Date: Fri, 18 Feb 2022 19:06:35 +0700 Message-ID: References: <87sfshgfvt.fsf@posteo.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Content-Language: en-US In-Reply-To: <87sfshgfvt.fsf@posteo.net> Received-SPF: pass client-ip=116.202.254.214; envelope-from=geo-emacs-orgmode@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: 38 X-Spam_score: 3.8 X-Spam_bar: +++ X-Spam_report: (3.8 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, FORGED_GMAIL_RCVD=1, FORGED_MUA_MOZILLA=2.309, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, FREEMAIL_REPLY=1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, NICE_REPLY_A=-0.001, NML_ADSP_CUSTOM_MED=0.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1645186094; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=dxX70vAbY8ySU9cfCSRvR3KukMqVvU0KAJe/pAdqpWM=; b=nk+mhf9RivTrRGrI1InCU5ICVK8CWGCgCkoW7KfI+KccEiWNCPmcyNeGeSOrfhBis4APFb KljRW2EX4Sc6wt3umxnYNLdRim6hYfX9Exwr1MX36LtuqTzT08psRHpNJsLY1S8etPhvzt iY8o1cCmIEGoW1Ok9aMBUTVYb8kyftSQ4h4zcT/5ZE/euDOk3KUa1yNkErYwO5IcZf61nE xf0UnnEwtLtWywkvxkMoxKMvdj2ZHHxiAD5L5WDSjukbjmURPsQaY537MyVSZ0oL+YbCkq EZUfzCa3V5KPpGr7COMuhheCw2RfBhnzOernSTb0vLZ448eFhb9RJnPf+lzFiA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1645186094; a=rsa-sha256; cv=none; b=DVnI067akc7h9ar3Cl1/gnpzzPkXar1nNmnmr4i0caYV484LQi8g+/vJ8UyDWZ2eV8EE57 +T+ZlAR9Uij3pqDJ1siiISuxIzdCajIRGia47xsRiL9z6HFDI4FvDCClPveitkRjn8ti6i 1EZAR/AGw4f3h5WApwScHDILk+EkwVEcjeC8O7lsMrrys7c3YRO210fasgY1qNcEJRHcFS XNakr8Eqs9wzpKr33ADMGYR9sP/k1GAS6Jo7eDg+cP3g/D1kgSezeKgkPRNUJqXIdRqBmc ibJraMTuyVaww0BdhbMUW02kpHjDOzHwgS4D3MkaSac8QPvBjKhwDm4FXH1dOg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -2.53 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 4CC222AF53 X-Spam-Score: -2.53 X-Migadu-Scanner: scn0.migadu.com X-TUID: sXk1q6Mq+/e7 On 18/02/2022 07:47, Juan Manuel Macías wrote: > > Otherwise, if you export to LaTeX with pandoc (v. 2.14.2), the result is > (to my surprise) correct: > > str="/lorem /ipsum/ dolor/" > pandoc -f org -t latex <<< $str > \emph{lorem \emph{ipsum} dolor} 2.5-3build2 from Ubuntu-20.04 works in the same way. I like such behavior: echo "/lorem =ip/ sum= dolor/" | pandoc -f org -t latex \emph{lorem \texttt{ip/\ sum} dolor} I know at least one more persons who will be happy as well: https://list.orgmode.org/87pmtqp79s.fsf@web.de/T/#u mid:87pmtqp79s.fsf@web.de (tracked as a confirmed bug at https://updates.orgmode.org/) printf '/lorem\nipsum [[https://orgmode.org/,service][dolor]] ipsum/\n' | pandoc -f org -t latex \emph{lorem ipsum \href{https://orgmode.org/,service}{dolor} ipsum} > Another (more abstract) doubt that arises, although I am not an expert > in matters of grammar and specifications. If nested emphases of the same > category are not possible in Org, should this be understood as a bug or > a feature? What implication does it have if a external parser, like > Pandoc, parses them just "fine"? Nicolas Goaziou explicitly stated that current behavior is correct, see "[Patch] to correctly sort the items with emphasis marks in a list". Tue, 20 Apr 2021 22:37:31 +0200. mid:874kg0ae0k.fsf@nicolasgoaziou.fr https://list.orgmode.org/874kg0ae0k.fsf@nicolasgoaziou.fr/ Nicolas confirmed it when I posted a similar example later in the following discussion: Ihor Radchenko. c47b535bb origin/main org-element: Remove dependency on ‘org-emphasis-regexp-components’ Thu, 18 Nov 2021 20:25:33 +0800. mid:87tug93b2a.fsf@localhost https://list.orgmode.org/87tug93b2a.fsf@localhost/ > My intuition says that the current parser behaviour is not correct. It > would make more sense to prioritise link over italics. However, it would > require a major change in the parser - instead of a single pass, the > parser may parse different types of objects sequentially. Nicolas Goaziou. c47b535bb origin/main org-element: Remove dependency on ‘org-emphasis-regexp-components’ Thu, 18 Nov 2021 13:35:19 +0100. mid:87y25l8wvs.fsf@nicolasgoaziou.fr https://list.orgmode.org/87y25l8wvs.fsf@nicolasgoaziou.fr/ > I disagree. Priority should be given to the first object being started. > This is, IMO, the only sane way to handle syntax. And once more in response to my message: Nicolas Goaziou. org parser and priorities of inline elements. Sat, 27 Nov 2021 20:02:31 +0100. mid:87mtlppgl4.fsf@nicolasgoaziou.fr https://list.orgmode.org/87mtlppgl4.fsf@nicolasgoaziou.fr/ > I don't see any incentive to change the order objects are parsed, once > you know how Org does it. This is just a red herring. What is useful, > however, is to fontify them the way Org sees them. So formally this feature of pandoc is a bug (due to different kind of parser). It is the reason why a corpus of tests should exist in a format that can be easily imported from various programming languages.