From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id QJymDpYdpGE+gAEAgWs5BA (envelope-from ) for ; Mon, 29 Nov 2021 01:23:50 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id KCFrCpYdpGFdJQAA1q6Kng (envelope-from ) for ; Mon, 29 Nov 2021 00:23:50 +0000 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 D3FF4E23F for ; Mon, 29 Nov 2021 01:23:49 +0100 (CET) Received: from localhost ([::1]:50558 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mrUSR-0007PM-Qj for larch@yhetil.org; Sun, 28 Nov 2021 19:23:47 -0500 Received: from eggs.gnu.org ([209.51.188.92]:40262) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mrURq-0007Op-Tj for emacs-orgmode@gnu.org; Sun, 28 Nov 2021 19:23:10 -0500 Received: from [2607:f8b0:4864:20::62d] (port=42908 helo=mail-pl1-x62d.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mrURp-0003e8-18 for emacs-orgmode@gnu.org; Sun, 28 Nov 2021 19:23:10 -0500 Received: by mail-pl1-x62d.google.com with SMTP id u17so10686630plg.9 for ; Sun, 28 Nov 2021 16:23:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=gD1dR/QveWusYVXLaE+kk5GJSG4ACi1lCEEU/ca+OBE=; b=gAxbIfuVYK1OdMH5u8F6rAQeeCa5+6wow1g2o6BMTro6AJt0XnPFTbddPsq16yVPxf pB5GfjDGeiHA19GcVlBJhg/y+TO4/PEhDqz6cBDKgSBnOfqksmWG+OHHsvh9uMrTZZ9N jHQTvLyw10DnljkdG2sUlES1KMeWcXk5hdgMQ4NMWgxNmwU74VnphdxvLCfm+E4N3k3s i9gnDTIOeX/fwDux/OFnvTSVcINHqpUZ0Z3+gkoRK1DXA3kEtI92Weenxsk3SBNFwtF+ 2c6PVQBeh2SiVDK37VXG7vukrn5X2R+QoK3Am1XqoGlzj6chLBhH2H9946D8pmFFYdV7 LHcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=gD1dR/QveWusYVXLaE+kk5GJSG4ACi1lCEEU/ca+OBE=; b=LuCw1rO4vbaWm5OKzO3Skkw4ge1rO3FCCQ7nhfhQYPZ1hD0ne0RvEg8j0JNtL9q98b MprJqndM+7T6HzvIi1HxSAsKjxDAcMDW96GCKBQvTA+rSOK08Q0rOG5c2J2zManbkdfB TMvbbiV7X63HwyIgsGDzP2l+UsLGTm+/4MHfBrBXcY602qe3tBDpfxCThEEqqvo9BWfw Ym3TiREQWvmmzm+hTgukIwXRKBcmlIMDRgUjA2NBVvtuzR3h+y755pDi9aniL9cFdC/9 R69R7VW2nGI3z+e65j4TNf6P6ySZYG+OBm9QlOhYteJNN9T3w5h3vm6/gLAq3w3qsdXI b2oA== X-Gm-Message-State: AOAM531ekGb/eXZyAzClkPtHZht+u/NDFmT0v1OoHcf2V8RkHzCBg57y UnD4kliY6Y0LDvOm+25H/+MVu7ExMNA= X-Google-Smtp-Source: ABdhPJw4eMJpyeUNCq37vxSlZ7AhTM2wOhFnRrYQa1q0uxFLDXzw32sVdkHsrxmj9cSk5PczdlLRVA== X-Received: by 2002:a17:902:d114:b0:142:3934:be82 with SMTP id w20-20020a170902d11400b001423934be82mr55732369plw.40.1638145387106; Sun, 28 Nov 2021 16:23:07 -0800 (PST) Received: from ryzen3950 (c-208-82-98-189.rev.sailinternet.net. [208.82.98.189]) by smtp.gmail.com with ESMTPSA id l14sm1392965pfu.149.2021.11.28.16.23.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 Nov 2021 16:23:06 -0800 (PST) From: Matt Huszagh To: Max Nikulin , emacs-orgmode@gnu.org Subject: Re: [PATCH] Fix regex for determining image width from attribute In-Reply-To: References: <87czmtuy0p.fsf@gmail.com> <87ilwl71gh.fsf@gmail.com> <87a6hxuw0y.fsf@gmail.com> <877dd07fnb.fsf@gmail.com> <8735noqig0.fsf@gmail.com> <87wnl05ag6.fsf@gmail.com> <87y25fq5d2.fsf@gmail.com> <8735nnlaef.fsf@gmail.com> <87v90jph1w.fsf@gmail.com> <871r37l96a.fsf@gmail.com> <87k0gzpb5s.fsf@gmail.com> <87h7c2pb6w.fsf@gmail.com> <87ee75pmsn.fsf@gmail.com> Date: Sun, 28 Nov 2021 16:23:02 -0800 Message-ID: <87czmjajyx.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::62d (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::62d; envelope-from=huszaghmatt@gmail.com; helo=mail-pl1-x62d.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 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, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=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" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1638145429; 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:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=gD1dR/QveWusYVXLaE+kk5GJSG4ACi1lCEEU/ca+OBE=; b=Tp7BxwsJzwJVioJ+3sOMPUxBRcR41Q6QL6xUS3jW2Hb+aWgqo3O8bJ0FGSqMfdLa0Tm6oW JXcoCJdad3Pmx6QeB+y0yfDLc8kD2noPsRp86u0ruXdC2DIJ5kg7jB6EqMo1YTFxRw5AVq kAb6yum7iHV9rqsFfE1HKaKxHkXy6mahgfOkzbAjfBtCmO1KF9ZU7CyDo4y61vhWK7EO9y q7P8cgUfUyYDwv8uzQByrhGmdBPRhkAi/XnkJUdR/qhI25c27Nn9o6w13m7VEgfcnOdd9Z t3rwfzP1cUPeQpUvNqPzrw3GXgQofxoVz2eSYO7oCTqHggAQllmC3Gi6+paq4A== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1638145429; a=rsa-sha256; cv=none; b=bUuARaMxdeasJJUNF9DtTcnC3YYxv3qC0W5NqWVDAH/Z1mYBKPsPD9KHqZ/iifVbSp25Rv f5CuLqyVdWEvFbmcHc+3Dy+mnUvkn8wEmJX0TPposn0OqxD3xY4cf7pzbWQ94/22EbwEVG jQkG8yaz3nINXzOI17qPudoNDdAHqvfTVchC0hW9M/QtYrxfO7q6ozigTQ5Agak0btvYDp dRm3n5Q+gcD4Q0vVFPSC+yVDDvHNOar2kUvz59APLr3IcB3rDFbZl01EODbjMvg2SFmSeG TiFTG4zsJoLUy2FZYSAzILiyb8c5CTeInSUSXIQrAQTX0vWskQygCEtOwUj0uQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=gAxbIfuV; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -1.81 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=gAxbIfuV; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: D3FF4E23F X-Spam-Score: -1.81 X-Migadu-Scanner: scn1.migadu.com X-TUID: jkqpzw4hI+fM Max Nikulin writes: > I am confused. I can not figure out how to create the following as HTML > export result: > > An image without :width 600 attribute > > Attempt to add quotes leads to " and does not prevent ":width" to > become another attribute. > > #+attr_html: :alt An image without :width 600 attribute > [[file:img.png]] > >

An image without >

> > My current variant: > > ":\\(?:[^\n]*?[[:blank:]]\\)?:width[[:blank:]]+\\(\\S-+\\)" > > The regexp should not match e.g. > > #+attr_html: :alt something > :width 600 > > P.S. I would prefer to use the same parser as ox does. (cadr par) contains all the attr_ keywords with their values. I think it would be better to use this instead of doing a regex search, which I expect would be slower and more prone to errors. If we want to be strict (and probably more correct), we could use org-export-registered-backends. Otherwise, we could look for any key that starts with attr_. I can probably implement this if people want. But, let me know if I should indeed use org-export-registered-backends. However, I'm starting to feel like this should be separate patch (the goal for mine was just to prioritize attr_org). I also still don't really like the behavior here. I don't think it makes sense to interpret a width as 120% if we have something like #+attr_latex: :width 1.2\columnwidth Matt