From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id 4J5qB6W2gWTq3wAASxT56A (envelope-from ) for ; Thu, 08 Jun 2023 13:08:21 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id WA9bBqW2gWQBTgEAG6o9tA (envelope-from ) for ; Thu, 08 Jun 2023 13:08:21 +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 DC39B337C3 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 1q7DUQ-0006lZ-Cl; Thu, 08 Jun 2023 07:07:38 -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 1q7DUO-0006kc-9N for emacs-orgmode@gnu.org; Thu, 08 Jun 2023 07:07:36 -0400 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q7DUM-0003mp-3C for emacs-orgmode@gnu.org; Thu, 08 Jun 2023 07:07:35 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 96BD7240104 for ; Thu, 8 Jun 2023 13:07:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1686222446; bh=XTC9Smdq2qxQyvQBTsDt9sPglUYxXC8+90tKrsxnfCY=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From; b=HYeTQOAB344AZ6IDSGnPRSRIPpPJ9r/V9Jz2danal4HhTEBM/gexCkYBCuZOvNXW0 3vdyAhzgONgCFdfyFegCJsaYoYlqENpHlrg0xtkvMp3nYFW67bCrUbKPI8NlwvDQa/ 371nqV2gnzKVCSPtbjqGfBWNfln0F8LoynU1yTLFa3KBuixho1GYe35AF1rge5rvHk mB89HZYlZw3clF1YUFZ+MkBiGJGCWwpecFRaz6n7eYN8vDCqMpFI9dH8rSTkcU35bi pShZr6SRkIB57CVU0iMvyZgBUzxtn1dEIBSlgYTOrHxhtK9Po/7Q4vpnFFDsHEi/4W nZ9H/V6c+k7Qw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4QcLyj4Bh7z6trs; Thu, 8 Jun 2023 13:07:25 +0200 (CEST) From: Ihor Radchenko To: Laith Bahodi , Timothy Cc: emacs-orgmode@gnu.org Subject: Re: Parsing nested markup objects In-Reply-To: References: Date: Thu, 08 Jun 2023 11:12:10 +0000 Message-ID: <87y1ku1a45.fsf@localhost> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@posteo.net; helo=mout02.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=JF1qtM54CkFtnX3Y/TRSuvzNuWuYikEV4o6qbPUXL/M/EhyWtJhn7Fi1+JMyqXxKvgDVy/ Iwr5Bv1BccFROq2myvtNWGaJJLuCkhiLdOPY7dqT85XxsM+jom7E7OFVcmy2fMbfRRea65 BcywtSAZuji8elTqsq7R12DVpFFGZ8etmYsHHea8DCmshHSzs2OWYnVlLrHVf8k0t7yMDN TFeggEAcM/oMEViD878ysQrortj7Hu+7fKYSxbnvn4kkn4VaZHAMgkDb6uSVG5qT0u1QAb Z9/AlqhgH7XSHqkiPu0fvsxJxXMX08V5hz3k5XkLecPaJ99W3cy++GkATRo8LA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=HYeTQOAB; 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=HhVE+wlxscgdHM1EdyIU2+RGDswkKwlVte7dt4JW1zC1go82+n9BihZxNZQLQqhjqZIn1e 8+pxB0qf5kFM9jm3A/bM4ywoSyHxVDMYfS7AolbpxIgmJll3b2dGbL7Gw/+PrzFUy0HeUQ Wzn7KGEBI52UJbDQUhkb1AD0nubTfc9NR+H/+nma6P2oh0uwvp0Gn1ewkqDLjKTvaUYlxF vGNPyI1Gwj3k4qev7IHMDlJlaVM5FRI8SWzstPO8k/NM0BpvRVipzKnst7poTVXdwu4EpB VyVD8c42S4EJTa0U7LYehHy7ETdNNXjXRXKZPd34jDBKHqM3oAJrRXCbx0elBQ== Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=HYeTQOAB; 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: DC39B337C3 X-TUID: lWEXIqAhkncK --=-=-= 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 --=-=-=--