From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id WINdOuVxLWTUpgAASxT56A (envelope-from ) for ; Wed, 05 Apr 2023 15:04:38 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id 0NVMOuVxLWTQ9QAA9RJhRA (envelope-from ) for ; Wed, 05 Apr 2023 15:04:37 +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 844AD1E849 for ; Wed, 5 Apr 2023 15:04:37 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pk2na-0002SX-T1; Wed, 05 Apr 2023 09:03: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 1pk2nY-0002SC-1y for emacs-orgmode@gnu.org; Wed, 05 Apr 2023 09:03:36 -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 1pk2nS-00013F-KM for emacs-orgmode@gnu.org; Wed, 05 Apr 2023 09:03:33 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 98F9E2403E1 for ; Wed, 5 Apr 2023 15:03:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1680699808; bh=WOdNKIwsfiGIS33vo6Ufo5rVmbz9I8PAC9EoNHVA8JY=; h=From:To:Cc:Subject:Date:From; b=BAjKhYbqc6Mn4yRqRVTfkMFc2vKCu85R7GGz15Yso3gCB8uprYEn2ESBQbguG464z AFBfD5r/IBaLkISx3J91xXevIY7JnxvN2/ZhuLatVhs60syM+4iWFwnu5ljB1DrTDN TDjtazera67enuhTVMQOJHcKsou0P/kefykcvPNw4fN20/ZyUh0UO2rLNUWIzNPQ7K 6nUsAvVzk/D6wKnURymy6n35qtvuT7/onJWT7EY/i/I6hsfAKWhcee7Aa3OJuhMlu6 UVlnp8Be0MDP/juE8UcVpupNi2QXSJ6FU36IjOd19wzOPzfWDDmNZDCiGhWGSxToOz 7TLbTn7WQDATw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Ps4Z81HJmz6tmv; Wed, 5 Apr 2023 15:03:28 +0200 (CEST) From: Ihor Radchenko To: Max Nikulin Cc: emacs-orgmode@gnu.org Subject: Re: [BUG] ox-md image captions In-Reply-To: References: <871qmbym7y.fsf@localhost> <87a5zoav86.fsf@localhost> Date: Wed, 05 Apr 2023 13:05:50 +0000 Message-ID: <871qkyjx75.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_H2=-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-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1680699877; a=rsa-sha256; cv=none; b=h9SXyjALVRMKef1F3Om8PV1amEJOrCmcFR9xpOoCQrinymxdWz4RQAZynSDZzpNbywAXbq 0sv93GZNjFyhdPxwUtHSs2GldVSHhgUXmMua3Y6a9EEKQEbJbeoHhJ9Ppn14ye4ItoRUIi 7f5c3DMgtKgDN0EMFK4Ldx/sBpx/ITUjbdx3fyJX8Mw8cFjJIrygCc8sWySwDOtAvYeaLu MAVzVSL+vupxgVcewE5aesWrOgUfBBVcPgY/oO8RO1p0cUeyPYR3vJhHBHr0LFzjHFxgHK VP+6gan8yBjT/16bPYSD1kZ4kyiGN47FtrtTIO0GiT+QTFAEzhMUwD3/smz+gw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=BAjKhYbq; 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=1680699877; 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=UPByy2VTHzH1oibb3t16TOUY4I1sDKSPBb8XFR5YcmE=; b=oYfPhSufQh9hTRJygQS5F0d6rXx0vsEvVvQCIC0wXqQxvNTJ3uKxNsE5BILLyJhXf7Aw+6 WaASVLFkhKBB7LSPD5HOqTYz/p/PdA0GV3ioQOpVP07Ynk6HMz3w6fYr4Ll0dKikd8m6xy +EgC+myTxVxmQ+sEPIZ/ZGw/tO0fhoGKFZetcbfT91nFz7YFp1Z31OxPkQ+8NGBuCX/riV mA3DUWuy5C5s17eZNh4g99TTQPlX8vtoJsdkVHvR+kq5lZrwhZyg7xsN99BJxmbMF/wHa5 Tkh5wTPny7NRUiSgp/UvZtiRhlnIEGAHxlc/NW3SfsTjmmRguLlhlEA6xNQNOw== Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=BAjKhYbq; 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: -11.81 X-Spam-Score: -11.81 X-Migadu-Queue-Id: 844AD1E849 X-TUID: a50vYxkTyO4y Max Nikulin writes: >> Upon further investigation, I have found that our base MD reference we >> follow in ox-md is defining image syntax as the following: >> >> ![Alt text](/path/to/img.jpg) >> >> ![Alt text](/path/to/img.jpg "Optional title") >> >> https://daringfireball.net/projects/markdown/syntax#img >> >> Therefore, Org mode is doing everything right within the scope of MD >> specification we follow. Pandoc does not. > > My reading of > https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#the_title_attribute > is that caption should not be exported as title. Alt text is more > "visible" than title, but perhaps caption should be exported as text > adjacent to image. I will provide the linked text at the end of the message for future reference. For HTML, I agree that caption should ideally be exported as text adjacent to image. That's what we actually do in `org-html--wrap-image'. However, we are talking about MD export. MD has nothing to do with how Pandoc's "implicit_figures" extension modifies MD->HTML export. The original MD spec only talks about image description and image title being exported to "alt" and "title" HTML attributes. Currently, Org's image link description will be exported to MD's image link description and Org's image caption will be exported to MD's image title. Doing otherwise by default is not entirely consistent. Of course, the current default will also ignore #+caption altogether unless the image link has no description. So, we may, in theory, play around with the default. On the other hand, by keeping the current default we also keep the option to combine description and caption if we ever consider altering our inline image rules during export (`org-export-inline-image-p'). I am still inclined towards keeping the current default, as not every possible MD export user is doing it to consequently convert the MD to HTML using Pandoc also having the "implicit_figures" Pandoc's extension enabled. We may provide a toggle for this, however. If someone is bothered enough and sends a patch. Maybe #+ATTR_MD: also option. ---- https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#the_title_attribute The title attribute is not an acceptable substitute for the alt attribute. Additionally, avoid duplicating the alt attribute's value in a title attribute declared on the same image. Doing so may cause some screen readers to announce the description twice, creating a confusing experience. The title attribute should also not be used as supplemental captioning information to accompany an image's alt description. If an image needs a caption, use the figure and figcaption elements. The value of the title attribute is usually presented to the user as a tooltip, which appears shortly after the cursor stops moving over the image. While this can provide additional information to the user, you should not assume that the user will ever see it: the user may only have keyboard or touchscreen. If you have information that's particularly important or valuable for the user, present it inline using one of the methods mentioned above instead of using title. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at