emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: Dov Grobgeld <dov.grobgeld@gmail.com>
Cc: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Re: Newline woes when exporting to mediawiki markup
Date: Tue, 01 Jun 2021 11:08:00 +0200	[thread overview]
Message-ID: <87tumij6kv.fsf@nicolasgoaziou.fr> (raw)
In-Reply-To: <CA++fsGFFTqViynH9d=e_tX8B9SDQNsaWxm-rgo8qCH9y2f18wg@mail.gmail.com> (Dov Grobgeld's message of "Tue, 1 Jun 2021 10:59:50 +0300")


Dov Grobgeld <dov.grobgeld@gmail.com> 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.

Nicolas Goaziou

  reply	other threads:[~2021-06-01  9:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-01  7:59 Dov Grobgeld
2021-06-01  9:08 ` Nicolas Goaziou [this message]
2021-06-01 20:41   ` Dov Grobgeld

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87tumij6kv.fsf@nicolasgoaziou.fr \
    --to=mail@nicolasgoaziou.fr \
    --cc=dov.grobgeld@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --subject='Re: Newline woes when exporting to mediawiki markup' \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Code repositories for project(s) associated with this inbox:


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).