From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id sMUqN6S2gWRmygAASxT56A (envelope-from ) for ; Thu, 08 Jun 2023 13:08:20 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id 4PqONqS2gWRJqQAAauVa8A (envelope-from ) for ; Thu, 08 Jun 2023 13:08:20 +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 7E4372C2E3 for ; Thu, 8 Jun 2023 13:08:20 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q7DU6-0006hm-IT; Thu, 08 Jun 2023 07:07:18 -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 1q7DU4-0006hD-Jr for emacs-orgmode@gnu.org; Thu, 08 Jun 2023 07:07:16 -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 1q7DU1-0003hi-QC for emacs-orgmode@gnu.org; Thu, 08 Jun 2023 07:07:16 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 55490240028 for ; Thu, 8 Jun 2023 13:07:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1686222430; bh=XTC9Smdq2qxQyvQBTsDt9sPglUYxXC8+90tKrsxnfCY=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From; b=W/Jt8ZO1W6a2RztByQ3cImuZz0IEquAzmmwKdAjPC1Z4eeh3XMXNg5zzuUBl1Q/Kk kfjeT6lgsCrr9O+lp050Icc1bTyRSg8vC/gn4xSVBLea270alA7aZp5xT+llZiUTXS xbcF3HcZKZVWSD4gUaHVFo3SwuzLxvAKTE1ijAG0k5NPxeZzuubHVnwN1jqKLyoL7u zZmG8EOFBNhb/GH6VJ3LyiyuPcQN9GLco3BUu/Hk9cB5V8uh/ZjUD//SKtHfTkZlBB 5urotMvX5RgcttWOYgFThLbVqTO4ktOYB2nOjHbi/uJAMa5/stR6c4GspRoY5RawIV 6fJvCvz5EhYaw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4QcLyP0nDcz9rxP; Thu, 8 Jun 2023 13:07:08 +0200 (CEST) From: Ihor Radchenko To: Laith Bahodi Cc: emacs-orgmode@gnu.org Subject: Re: Parsing nested markup objects In-Reply-To: References: Date: Thu, 08 Jun 2023 11:11:53 +0000 Message-ID: <87zg5a1a4m.fsf@localhost> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1686222500; a=rsa-sha256; cv=none; b=khm75P0On/XwvhK8ec0Dm9ebZb/Rb+w4sDyBytAi7pol/xp9V0YoXIzkncDV42O1LQz5Wj k62CBlUlJqBrst1l2dwhfwdm3J7APu6apm8SRydPnOrdcbCn48TCnwFu2/Ur71KHjpIriv fuygb6Th60cYSrL9tJ04Yvjx2gF62iYu9Wsb0TqpsNGvDLMaY2Q3BzVXbM6pVieQ9+ajDb wzAjaGlLYR5JNd5DWk8w3S/5DfO68xLlgBAWwgn1t4E4hfHv//8KTO0D156ZyWzhyfQQUJ zurgrsIahOg1d/SC7+gHbTgudkQt4zG6sZ+5g7tRs1eKMCv8i53f0jvRpSy1cg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b="W/Jt8ZO1"; dmarc=pass (policy=none) header.from=posteo.net; 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=1686222500; 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=NG6mJNnP3cuRBzsGNINWfNQDOpTxS0QtiR78bTI8NEk=; b=UqoXCBtnhX+CnODkBx5BpGtbV26Fr6eCYcdnAN2FT03Y7OLkNzuTnBoGYk0P+1zxBtULi1 vOMF/RVPtj/2JCSwf95gvTHHOAR+DVAISdz1ve8XAnfetgW45nlwc4H5Md3BfCXGF/9tGm A6UeIftq/s41J7aYfD/Hf5H8UjYt74C1uyCDRLbjrYwWAEKOIl/XC6zFNUz2+K3s22AVfX /+zeetYCFerc+qDrDWALlOsN3qMEN/76MwYNYTZSBL/rt3v+dicyn1v5C80IxrPEprPzlG pjlznqcQ7rzmbc3oqlIvKNR+RMkb1Xlz7wsbBj3OV7X77j/DVhlyTmDcv3hwbQ== Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b="W/Jt8ZO1"; dmarc=pass (policy=none) header.from=posteo.net; 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-Scanner: scn0.migadu.com X-Migadu-Spam-Score: -8.27 X-Spam-Score: -8.27 X-Migadu-Queue-Id: 7E4372C2E3 X-TUID: TKCzuxdixf6K --=-=-= Content-Type: text/plain Laith Bahodi writes: > Hi! I'm working on a parser for org and I noticed something about > nested markup in the syntax spec: markup starting at the limit of > another object seems like it shouldn't be interpreted as markup. The > spec says that the precondition characters are: > > PRE MARKER ... > PRE > Either a whitespace character, -, (, {, ', ", or the beginning of a line. > https://orgmode.org/worg/dev/org-syntax-edited.html#Emphasis_Markers > > With links, since `[` isn't in that list, the spec seems to imply the > following wouldn't contain an italic block, but it does: > > [[https://example.com][/according to the spec, this shouldn't be marked up/]] > > same goes for */abc/* (since `*` isn't in the set defined by PRE) Fair point. We indeed missed this detail in the syntax blueprint. Does the attached patch clarify things? --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-org-syntax.org-Special-tokens-Clarify-recursive-matc.patch >From 974786c726e151ea6bb709bd508faab1cc155fcf Mon Sep 17 00:00:00 2001 Message-Id: <974786c726e151ea6bb709bd508faab1cc155fcf.1686222568.git.yantar92@posteo.net> From: Ihor Radchenko Date: Thu, 8 Jun 2023 14:08:30 +0300 Subject: [PATCH] * org-syntax.org (Special tokens): Clarify recursive matching Explain that contained objects are only matched against parent contents. Reported-by: Laith Bahodi Link: https://orgmode.org/list/CABhQr0TRuGeJMn+G5xzqJuX=UhvwiBHJr1+P8qqDRhA8KUpPfQ@mail.gmail.com --- org-syntax.org | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/org-syntax.org b/org-syntax.org index ee05c5a8..7073442b 100644 --- a/org-syntax.org +++ b/org-syntax.org @@ -161,6 +161,13 @@ *** Special tokens PRE TOKEN POST #+end_example +/PRE/ and /POST/ token are only matched against the contents of the +containing object. For example, /bold/ object within link description is +only matched against the description text =*bold* description=, not +against the full containing link text: + +: [[https://orgmode.org][*bold* description]] + *** Case significance In this document, unless specified otherwise, case is insignificant. -- 2.40.0 --=-=-= Content-Type: text/plain > Also, how are these objects intended to be handled? I couldn't > pinpoint where in `org-element` this is approached. The parser narrows to the contents and starts from there, ignoring all the surrounding text. See `narrow-to-region' in `org-element--parse-objects'. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at --=-=-=--