From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id mPs8AnaUJmUVAAAAauVa8A:P1 (envelope-from ) for ; Wed, 11 Oct 2023 14:26:30 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id mPs8AnaUJmUVAAAAauVa8A (envelope-from ) for ; Wed, 11 Oct 2023 14:26:30 +0200 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 74ADD4506C for ; Wed, 11 Oct 2023 14:26:29 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b="UnK/qrNv"; 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"; dmarc=pass (policy=none) header.from=posteo.net ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1697027190; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=BVwGvSlF2u8fbRyzEJaM6T80T48qPje9eJKzdCdecwQ=; b=Lo2jifFZmJPb+HqpEC9R4XucYrarnc0t8Xj1gkuk25gpicSPwibOdhRLwVFhSWmWBKPI7p k4bNWotj0yz1zHRcgZsWuzVmP9IgcihR0fwW5uUv5Sslfl8c6m1VUwKsVyEqOys2OrMYLV G1roHqaSdq0rnqYgZtq0/WWNocbmF/diCTosBqIsWC2pFTYyEpFhnDH5b3cWows1GtBjT3 OlA4iK7vnBWaUvhgk/IoosTk6hyIT0NzJlZr/X4cOyu8/KpKomAQ5LvRpCR0lCKeXAYKSG EWR5aG2qikwmlcvirBLNKTmeWKbIoPN9KpQgGCzFjfOWULcuB77YoJYkc2R7+w== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1697027190; a=rsa-sha256; cv=none; b=EKFW3fiotRIPa9C1n5Fy0tfPYflBXosr7rpE5vHNtJ83Q+kKqRiJ/MKdMSiQ5588yYLTyV XdB4UEfIY1946RR8jpkI30Eh1ygZur9Jb4MvzUCGQGtr/tbf6C1LfsXinJ3yP2uCosmpBH 2j7m0MTwbKhSphdtFpmo4ZVnG9YIRjQl0vn1eNqDCjkA2rGAgGmjJnTLK1pa/DJDPv0Qx9 E3tvVqHcUyX64iDyc2Uqg3esDPBHY5JiomEd53t1ibRL2i/h9ykhYYhAEmtQ3+GjAxMta5 0XWN2ne5x5P9Ua2Z8aJgjSY05dt+we8vbEy0cXRvNhUDAiSaRKcBDsY7C6Qv0w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b="UnK/qrNv"; 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"; dmarc=pass (policy=none) header.from=posteo.net Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qqYHK-0000Jc-Dn; Wed, 11 Oct 2023 08:25:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qqYHF-0000JG-0H for emacs-orgmode@gnu.org; Wed, 11 Oct 2023 08:25:25 -0400 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qqYH9-0007IQ-P2 for emacs-orgmode@gnu.org; Wed, 11 Oct 2023 08:25:21 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id D1329240029 for ; Wed, 11 Oct 2023 14:25:15 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1697027115; bh=+1nA2ijNaCT3M7w56+hRg0+f1DLIt/RBrj8Zduz9vzI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From; b=UnK/qrNv7ZShL6xt0YzOBRQOE9i8HgRvWiTQEdjPTnpNm0BAPfIX7+AEKPbIznCX5 Bjy5KCz6GXlrdVoqRP9wo/58XGUobKGf7gnJUXGYN14Y10K2T4DDbKdM+prCSz8esO HygYGD+K+MxkBOu6+XyGK2rtOhPEDoG57g5fryvrYV6x12aqLHmaSAXjQ2P4zlFrl4 TQGGONlKpIODl3qKiGbcE7bLheKYYo1FbmtGBAYXMIkU4f90mt10FW3iuOL+zz9fPl ly1p8WmmDvpv72v+UY5yRF/Skx/h7lb3Ii3tmKBrb7Sv0lWfoBW9ZQTXvY39tVmXWE Lyriyc9b5EsTw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4S5Bmq2Kg3z9rxT; Wed, 11 Oct 2023 14:25:15 +0200 (CEST) From: Ihor Radchenko To: Max Nikulin Cc: Tom Alexander , emacs-orgmode@gnu.org Subject: Re: Inconsistent text markup handling when double-nesting markers In-Reply-To: References: <8734yiadey.fsf@localhost> <2909a6ed-3a34-4aa1-a7bc-586169248029@gmail.com> <87wmvt7c5k.fsf@localhost> Date: Wed, 11 Oct 2023 12:26:45 +0000 Message-ID: <87ttqx73ay.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.65; envelope-from=yantar92@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Spam-Score: -6.09 X-Migadu-Queue-Id: 74ADD4506C X-Migadu-Scanner: mx0.migadu.com X-Migadu-Spam-Score: -6.09 X-TUID: Chq9ir/xTmO2 Max Nikulin writes: >> No, **bold** it is not a bug. The parser is recursive with inner markup >> not "seeing" its parent. So, we first parse the outer bold and then >> continue parsing the contents separately, as *bold*. > > I just find the following rather confusing: > > (org-export-string-as "**bold**" 'html t) > "

\nbold

\n" > (org-export-string-as "**inner* outer*" 'html t) > "

\n*inner outer*

\n" > (org-export-string-as "*outer *inner**" 'html t) > "

\nouter inner

\n" > (org-export-string-as "*begin *inner* end*" 'html t) > "

\nbegin *inner end*

\n" Maybe. It is indeed one of the edge cases. But it is following the parser logic, which is (1) first matching markup is parser; (2) parsing recursive contents is isolated. >> Be it another way, /*bold italic*/ would also not be allowed as >> we demand bol, whitespace, -, (, {, ', or " before the markup: >> https://orgmode.org/worg/org-syntax.html#Emphasis_Markers > > Certainly /*b*/ should work, but nested bold was a surprise for me. I > believed that nesting is strictly prohibited. The case of underscores is > even more tricky due to ambiguity of underline and subscript. It is not strictly prohibited on purpose. It is just a consequence of how the parser works that nesting constructs is almost impossible, except certain edge cases like **b**. > P.S. Juan Manuel at certain moment discovered that pandoc allows nesting > for *b1 *b2* b3*. Which is a bug in pandoc. I think we discussed this topic a number of times in the past - our markup is a compromise between simplicity for users and simplicity of the parser. This works in many simple cases, but edge cases become problematic. Workarounds have been discussed as well. For example, creole markup and generic inline markup constructs (your idea with direct AST and the idea with inline special blocks). -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at