Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RST nested lists and HTML output #880

Closed
gjx opened this issue Jun 14, 2013 · 0 comments
Closed

RST nested lists and HTML output #880

gjx opened this issue Jun 14, 2013 · 0 comments

Comments

@gjx
Copy link

gjx commented Jun 14, 2013

When I convert the following rst file to HTML, I get some weird behavior that doesn't happen when I convert to tex.

Using standard reST nested list syntax, the last item in each block of outer items has ``p`` tags in addition to ``li`` tags.

1. This
2. nested

   a. list
   b. will

3. have
4. *p*
5. tags

If you eliminate the empty lines, then item *b* is loses its ``li`` tag.

1. This
2. nested
   a. list
   b. will
3. skip
4. item
5. *b*

The same thing happens with unordered lists.

* Unordered
* lists

  - also
  - have

* this
* strange
* behavior

The HTML output when I run `pandoc -S -r rst test.rst -o test.html:

<p>Using standard reST nested list syntax, the last item in each block of outer items has <code>p</code> tags in addition to <code>li</code> tags.</p>
<ol style="list-style-type: decimal">
<li>This</li>
<li><p>nested</p>
<ol style="list-style-type: lower-alpha">
<li>list</li>
<li>will</li>
</ol></li>
<li>have</li>
<li><em>p</em></li>
<li><p>tags</p></li>
</ol>
<p>If you eliminate the empty lines, then item <em>b</em> is loses its <code>li</code> tag.</p>
<ol style="list-style-type: decimal">
<li>This</li>
<li>nested
<ol style="list-style-type: lower-alpha">
<li>list</li>
</ol>
b. will</li>
<li>skip</li>
<li>item</li>
<li><em>b</em></li>
</ol>
<p>The same thing happens with unordered lists.</p>
<ul>
<li>Unordered</li>
<li><p>lists</p>
<ul>
<li>also</li>
<li>have</li>
</ul></li>
<li>this</li>
<li>strange</li>
<li><p>behavior</p></li>
</ul>

And the text output:

Using standard reST nested list syntax, the last item in each block of
outer items has \texttt{p} tags in addition to \texttt{li} tags.

\begin{enumerate}
\def\labelenumi{\arabic{enumi}.}
\item
  This
\item
  nested

  \begin{enumerate}
  \def\labelenumii{\alph{enumii}.}
  \itemsep1pt\parskip0pt\parsep0pt
  \item
    list
  \item
    will
  \end{enumerate}
\item
  have
\item
  \emph{p}
\item
  tags
\end{enumerate}

If you eliminate the empty lines, then item \emph{b} is loses its
\texttt{li} tag.

\begin{enumerate}
\def\labelenumi{\arabic{enumi}.}
\itemsep1pt\parskip0pt\parsep0pt
\item
  This
\item
  nested

  \begin{enumerate}
  \def\labelenumii{\alph{enumii}.}
  \itemsep1pt\parskip0pt\parsep0pt
  \item
    list
  \end{enumerate}

  b. will
\item
  skip
\item
  item
\item
  \emph{b}
\end{enumerate}

The same thing happens with unordered lists.

\begin{itemize}
\item
  Unordered
\item
  lists

  \begin{itemize}
  \itemsep1pt\parskip0pt\parsep0pt
  \item
    also
  \item
    have
  \end{itemize}
\item
  this
\item
  strange
\item
  behavior
\end{itemize}
@jgm jgm closed this as completed in b04dfde Jun 18, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant