From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id OIATJXL5tWBNTQEAgWs5BA (envelope-from ) for ; Tue, 01 Jun 2021 11:10:10 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id QKmgIHL5tWD0dwAA1q6Kng (envelope-from ) for ; Tue, 01 Jun 2021 09:10:10 +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 D238214B63 for ; Tue, 1 Jun 2021 11:10:09 +0200 (CEST) Received: from localhost ([::1]:40210 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lo0PX-00055f-8L for larch@yhetil.org; Tue, 01 Jun 2021 05:10:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44740) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lo0Np-00053n-Cx for emacs-orgmode@gnu.org; Tue, 01 Jun 2021 05:08:25 -0400 Received: from relay8-d.mail.gandi.net ([217.70.183.201]:44523) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lo0Nc-0005lY-MQ for emacs-orgmode@gnu.org; Tue, 01 Jun 2021 05:08:21 -0400 Received: (Authenticated sender: admin@nicolasgoaziou.fr) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id 0D1721BF210; Tue, 1 Jun 2021 09:08:01 +0000 (UTC) From: Nicolas Goaziou To: Dov Grobgeld Subject: Re: Newline woes when exporting to mediawiki markup References: Mail-Followup-To: Dov Grobgeld , emacs-orgmode Date: Tue, 01 Jun 2021 11:08:00 +0200 In-Reply-To: (Dov Grobgeld's message of "Tue, 1 Jun 2021 10:59:50 +0300") Message-ID: <87tumij6kv.fsf@nicolasgoaziou.fr> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=217.70.183.201; envelope-from=mail@nicolasgoaziou.fr; helo=relay8-d.mail.gandi.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=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.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: emacs-orgmode 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=1622538610; 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; bh=WWqAKahR8FTPt+6tFmJdLML5ao4EJ0aR/2ArWt6Si+A=; b=ZDf3JgxBT+etEvOEXkA+utbrxceXOdi+BCMdf/kaguksAUF6blAhTgRqCR+r6B/Y9bJOvl THhQHbsj2myEVsaAjp59yuMgEj0tvSKhuEcD5tAQiXQS61ALRula7P61LB4gjJ0qTG0MLH dQAk3yTyTU4awlmP5nNrvvhpl5xQmw8YFzNCKzm51jwFzcrN6/3jIs3EW//LnXH2BQ/DAu xVZ8J5A4+PcxVCoFPrXufAOr/Gfptzafn/IjIFSWpEy4jbhmcCuG2drAkWolLm0J73oZ8J zajqf+42wGt+Ujefu3LC+yWWlLcLn4rB+StxkG+B3j4V8Nu2dJ9B1RN1YJhNLg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1622538610; a=rsa-sha256; cv=none; b=ROJITYhHzqou+kJ5KlZvztPGmyJOiOGRoYgAFZzjyat1O3PchhVM+nWEid3qsXDJRGON8Y BWoQjJ51+hwXMydcsct0nxcB5lW412zp5HB7p+qMEs49So34XFG8ULlMakFBO1+9aNNF/T rY8Laek+Rv1q9clWiUnclgTieQcRLvINsBCDZ/9Qbs+7qM+zeYyqe5FSZ6y658iMJmn6vf jJKr9oWEp2EB6q46s8bAAA6kZ6gFWtaH+lSHLKmrhkdlQmGc04O32ynB9b368V6rDVeZpD V4rNBlv5rej4K69P3NLDAVNOnFnetOOGnP1VF7/ZrTxjyq8hOQbnTzXUDzeasA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=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: -2.43 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=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: D238214B63 X-Spam-Score: -2.43 X-Migadu-Scanner: scn0.migadu.com X-TUID: VJCa48JdTDg5 Hello, Dov Grobgeld writes: > I tried to modify ox-mediawiki.el to solve the following two issues: > > - Get rid of redundant newlines between exported list items > - Replicate the leading asterisk to reflect the indentation level of the > list. > > To get of the newline I tried to rewrite the org-export "item" translation > function `org-mw-item` but I would either get no newlines at all between my > items, or an extra newline between two subsequent items. > > I just noted that ox-mediawiki is derived from the html backend, so perhaps > the limitations are there. > > I would appreciate any guidance of how to fix this. It's difficult to answer since I know neither what you tried nor what is correct syntax, but I think asterisks could be obtained with (let ((level ;; Level can be seen as the number of parent plain lists. (length (org-element-map (org-element-lineage item) 'plain-list #'identity info)))) (make-string level ?*)) To remove any newline, you may try (org-element-put-property item :post-blank 0) prior to returning. Regards, -- Nicolas Goaziou