jgm / pandoc

Universal markup converter
https://pandoc.org
Other
33.34k stars 3.31k forks source link

Markdown to pptx - speaker notes containing list #9552

Open dmail00 opened 4 months ago

dmail00 commented 4 months ago

Using speaker notes for a pptx, it is said that it supports markdown. However, the following does not produce a valid list

% List in notes
% 
%

-------------------------

## Donec sagittis

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus nec urna vitae quam tristique pellentesque.

::: notes

1. Aenean eget dolor tortor.
2. Donec suscipit velit tortor

1. Aenean eget dolor tortor.
1. Donec suscipit velit tortor

- Aenean eget dolor tortor.
- Donec suscipit velit tortor

+ Aenean eget dolor tortor.
+ Donec suscipit velit tortor

* Aenean eget dolor tortor.
* Donec suscipit velit tortor

:::

-------------------------

The first and second produce the same thing which is a list with two entries both prefixed by the number 1, neither of the unordered attempts produce a list yet entries on seperate lines.

Output pandoc_speaker_note_lists

Pandoc version? 3.1.12.1

OS Windows 10

dmail00 commented 4 months ago

I had a little play with the notes and lists. Included below is the an XML Pretty Print showing the difference between a note list created by Powerpoint and one genereated by Pandoc.

On the right is the Powerpoint noteSlide file and the left contains Pandoc's output. It seems there are a couple of differences, yet the main difference is the Powerpoint is splitting entries on a whitespace or punctuation char and creating a multiple <a:r> tags with an <a:t> for each these "words"/character blocks inside the <a:p> tags. powerpointList_pandocList

jgm commented 4 months ago

I don't think it's likely that the splitting of a:r tags makes any difference here. But if you're curious you could try modifying the working one to see if it breaks when you remove these splits.

dmail00 commented 4 months ago

Yes, you are are correct.

I minimised the input to just look at ordered lists so the input is the following:

% List in notes
% 
%

-------------------------

## Donec sagittis

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus nec urna vitae quam tristique pellentesque.

::: notes

1. Aenean eget dolor tortor.
2. Donec suscipit velit tortor

:::

-------------------------

Then had a mess changing a few other things that were different between the two. The Pandoc generated list contains the body:

        <p:txBody>
          <a:bodyPr/>
          <a:lstStyle/>
          <a:p>
            <a:pPr lvl="0" indent="-457200" marL="457200">
              <a:buAutoNum type="arabicPeriod"/>
            </a:pPr>
            <a:r>
              <a:rPr/>
              <a:t>Aenean eget dolor tortor.</a:t>
            </a:r>
          </a:p>
          <a:p>
            <a:pPr lvl="0" indent="0" marL="0">
              <a:buNone/>
            </a:pPr>
          </a:p>
          <a:p>
            <a:pPr lvl="0" indent="-457200" marL="457200">
              <a:buAutoNum type="arabicPeriod"/>
            </a:pPr>
            <a:r>
              <a:rPr/>
              <a:t>Donec suscipit velit tortor</a:t>
            </a:r>
          </a:p>
        </p:txBody>

Does the following block end the list and create another?

          <a:p>
            <a:pPr lvl="0" indent="0" marL="0">
              <a:buNone/>
            </a:pPr>
          </a:p>

It is only now that I notice that in the generated Pandoc powerpoint there is a blank line between the two entries in the list blank_line

When the block is removed for an ordered list, it gives correct indicies with the following being displayed: modified_pandoc