From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.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 wERMNsGGJGXVoAAA9RJhRA:P1 (envelope-from ) for ; Tue, 10 Oct 2023 01:03: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 mp11.migadu.com with LMTPS id wERMNsGGJGXVoAAA9RJhRA (envelope-from ) for ; Tue, 10 Oct 2023 01:03:29 +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 CFA796470C for ; Tue, 10 Oct 2023 01:03:28 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=fizz.buzz header.s=fm1 header.b=cEYTBaIy; dkim=fail ("headers rsa verify failed") header.d=messagingengine.com header.s=fm2 header.b=LskjMNZa; dmarc=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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1696892609; 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:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=Gz4vCita898307zGnpF00T+Cu03dhpoq8zLUpfOXlws=; b=ZmSwgc6ho5MGIfGWe5BgnmKwGMUPLB/BhmRZ2jSIlTMwb+lJePFALeDAa0jc1tWbOj79I0 cv9417hiEpcxK0c2NJGaPsGZd3zQS++SKsh5LOvOJtyvlsgGReUZVo10pOhM9Tq60odcxC VUmHxqPZP0laP5i2Jr+9RqkIYn2NGohQnIHqE2Qb+m34KK88jyBzRhiCnjwT3S5zkKYVT5 A0JX/wUXct9KkdTgHXvOK85peJOhEGDoVUB5m2BPq16mCDaIOs4LkLS8S7HBrLuQab0QxG eXOQdB7IVOhb/8mtuq3vmECPkWM1zLMeYTPNrYzGqLtWSzGSbNLzrKkpmE60mQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1696892609; a=rsa-sha256; cv=none; b=gZti/LNB23Xov4Ml1M3nTWMqeVwiWHg5ac6WX4n9vqtYV/ZHOPErcfya9OCKthCxzEVtCg WYEDP/XFq06PTnyPhXGe3ood3R4CJTZFmp5of1xs6uVm8K8mCNASZdvd3yL5sB5gnRjN3T adoiy8cDtnmUZ5WsFhcqufiLna0/FYjU1vY67XzUjZo2D+NnfLj1L1hP0VfpwDJn8LVwBb VHAkz9VCsQYPjJNTVJ+yymV7xIzLuKxlvl4bY9VR3nrikGfJleqpvX2AHZPzLtNWhWpYgv Holp1JZDI91traQBP2fIiK0rMJg/HNjcxSFId3+XaXBkh8y+WfkoJbiq2b46xg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=fizz.buzz header.s=fm1 header.b=cEYTBaIy; dkim=fail ("headers rsa verify failed") header.d=messagingengine.com header.s=fm2 header.b=LskjMNZa; dmarc=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" Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qpzGy-0006Kl-Nw; Mon, 09 Oct 2023 19:02:48 -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 1qpzGw-0006KX-MQ for emacs-orgmode@gnu.org; Mon, 09 Oct 2023 19:02:46 -0400 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qpzGu-0004Zn-CY for emacs-orgmode@gnu.org; Mon, 09 Oct 2023 19:02:46 -0400 Received: from compute7.internal (compute7.nyi.internal [10.202.2.48]) by mailout.west.internal (Postfix) with ESMTP id BB2753200B25 for ; Mon, 9 Oct 2023 19:02:39 -0400 (EDT) Received: from imap47 ([10.202.2.97]) by compute7.internal (MEProxy); Mon, 09 Oct 2023 19:02:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fizz.buzz; h=cc :content-type:content-type:date:date:from:from:in-reply-to :message-id:mime-version:reply-to:sender:subject:subject:to:to; s=fm1; t=1696892559; x=1696978959; bh=Gz4vCita898307zGnpF00T+Cu 03dhpoq8zLUpfOXlws=; b=cEYTBaIyE6gRv/7UUTGQnn6gMUn2q39DVyyyCJLt3 uSY0TAD8VoeARO9W4n1h5KYWzTxNeEiq6dGBrPoCW7dHvqnnXm9EwqrXfhakaaC1 MH5TiI9WbdHHtUXBxe56m0avhWCy9aoSGUWjjaWIR0nQ/6WKonVUkeMBHbTb1qQd JlnPayJnPrwf9I4c7xBOG0BO34xrwRPsGEhmZt9t0gMO0cml0DrOwHiltRTNrir8 Q5bPNMWNFLAoghFm+9qUM234SpUy9efacHfem5cvLJ8PZA+d+yO9p4eqzgpRQIBc S6xeqyaRrZneri4G/G0i9HYwR0p4LonabGO2Yi0mpysuQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:message-id :mime-version:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1696892559; x=1696978959; bh=Gz4vCita898307zGnpF00T+Cu03dhpoq8zL UpfOXlws=; b=LskjMNZa71cKaTr8CzCMN1PpPN8yI4TEhLoGFUvuIn1gBuVRUzA nHJpeLEUIRrU42m4bZAMTwTWZ1xhkQkUNi+G7KTzEpm3rUW2AfxkFOfWD5zzA7ph ALMj4h1pX7wxyueBEVPnif57t5HOEt2q9A50EXjsdr8qROgwbAK4IWwjPwlu97OU 9VB6KkDv+7Mv50OQs2l1ZoOAxcbFvq2xkkODx+ug8t/uoQfT0z0RWetO3UHobnWk MoSgRadikZczFS8YD+3OVuXVSHb1MScSGUJqdOmDsvsxEQg3enxwgalFxIhUTSKG knDHF5q1cJ1HVu2c3EnjSUpoxvn3accogVQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrheeggdduiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepofgfggfkfffhvffutgesthdtredtre ertdenucfhrhhomhepfdfvohhmucetlhgvgigrnhguvghrfdcuoehtohhmsehfihiiiidr sghuiiiiqeenucggtffrrghtthgvrhhnpefggfelieffgfdtleefhfekhfdttdetffeuhf egjeeiffeludekffekledvfffhjeenucffohhmrghinhepohhrghhmohguvgdrohhrghdp shhrrdhhthdpihhnthhrohdrohhrghdpfhhiiiiirdgsuhiiiienucevlhhushhtvghruf hiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehtohhmsehfihiiiidrsghuiiii X-ME-Proxy: Feedback-ID: i589b4368:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id EB15BA60077; Mon, 9 Oct 2023 19:02:38 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-958-g1b1b911df8-fm-20230927.002-g1b1b911d MIME-Version: 1.0 Message-Id: Date: Mon, 09 Oct 2023 19:02:18 -0400 From: "Tom Alexander" To: emacs-orgmode@gnu.org Subject: Inconsistent text markup handling when double-nesting markers Content-Type: text/plain Received-SPF: pass client-ip=64.147.123.24; envelope-from=tom@fizz.buzz; helo=wout1-smtp.messagingengine.com X-Spam_score_int: 17 X-Spam_score: 1.7 X-Spam_bar: + X-Spam_report: (1.7 / 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, FROM_SUSPICIOUS_NTLD=0.499, FROM_SUSPICIOUS_NTLD_FP=1.999, PDS_OTHER_BAD_TLD=1.999, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Scanner: mx0.migadu.com X-Migadu-Spam-Score: -2.30 X-Spam-Score: -2.30 X-Migadu-Queue-Id: CFA796470C X-TUID: H4WZq9w10eoK I used the following test document: ``` __foo__ **foo** ``` I'd expect the two to behave the same but the first one parses as: ``` (paragraph "_" (subscript "foo") "__" ) ``` Whereas the second parses as: ``` (paragraph (bold (bold "foo" ) ) ) ``` This pattern happens in worg at [2] Looking at the description for text markup in the syntax document[1], I don't see any reason the first wouldn't be parsed as an underline: 1. PRE: valid because it is the beginning of a line 2. MARKER: valid underscore 3. CONTENTS: valid. Series of objects from standard set includes both subscript and text markup, so regardless of how we parse the interior, its valid. Also cannot begin or end with whitespace but there is no whitespace in the CONTENTS. 4. MARKER: valid underscore 5. POST: Only valid if we extend the underline to the 2nd underscore so it ends at the end of the line. But the 2nd line shows us that having copies of the marker inside the CONTENTS is fine so I see two possible expected parses of the CONTENTS: 4a. (underline "foo") 4b. ((subscript "foo") (plain-text "_")) I also ran the following test document to further prove that having copies of the marker inside the CONTENTS is fine: ``` *foo*bar* ``` which parses as (bold "foo*bar") So the only way the top line would fail to parse as an underline is if it matched the first closing underscore as closing the underline, but that would be invalid because underscore is not a valid POST character and invalid copies of the closing marker are ignored as proven by both "**foo**" and "*foo*bar*". [1] https://orgmode.org/worg/org-syntax.html#Emphasis_Markers [2] https://git.sr.ht/~bzg/worg/tree/ba6cda890f200d428a5d68e819eef15b5306055f/org-contrib/babel/intro.org#L117 -- Tom Alexander pgp: https://fizz.buzz/pgp.asc