Not really sure how to use the HTML5 writer which I think I am using... 

```
$ docker-compose run latex sphinx-build --version
sphinx-build 2.2.0
```

And I do use `html5.py` because I always place my breakpoints there and it 
works. 

On Saturday, August 8, 2020 at 4:36:28 PM UTC+2 [email protected] wrote:

> Hi,
>
> This is default behavior of docutils' reST parser. It always generates
> paragraph node.
>
> >By default docutils removes these `<p>`:
>
> Please try again with html5 writer. It seems you're using old HTML4
> writer. It suppresses <p> tag on generating HTML. But HTML5 writer
> does not do that.
>
> Thanks,
> Takeshi KOMIYA
>
> 2020年8月8日(土) 21:37 Yves Chevallier <[email protected]>:
> >
> > I am wondering why Sphinx/Docutils add a paragraph around minor text:
> >
> > The list:
> >
> > ```rst
> > - foo
> > - bar
> > - baz
> > ```
> >
> > Will be translated in HTML as:
> >
> > ```html
> > <li><p>foo</p></li>
> > <li><p>bar</p></li>
> > <li><p>baz</p></li>
> > ```
> >
> > In some case it gives bad formatting especially if `<p>` has some 
> margins.
> >
> > By default docutils removes these `<p>`:
> >
> > ```python
> > >>> from docutils import core
> > >>> print(core.publish_parts('''
> > - a
> > - b
> > - c
> > ''', writer_name='html')['html_body']))
> > <div class="document">
> > <ul class="simple">
> > <li>a</li>
> > <li>b</li>
> > <li>c</li>
> > </ul>
> > </div>
> > ```
> >
> > But behind the scenes they are still there...
> >
> > ```python
> > >>> from docutils import core
> > >>> print(core.publish_parts('''
> > - a
> > - b
> > - c
> > ''')['whole'])
> > <document source="<string>">
> > <bullet_list bullet="-">
> > <list_item>
> > <paragraph>
> > a
> > <list_item>
> > <paragraph>
> > b
> > <list_item>
> > <paragraph>
> > c
> > ```
> >
> > Why is sphinx acting differently? Is there a way to tell Sphinx to not 
> add paragraphs in such cases?
> >
> > --
> > You received this message because you are subscribed to the Google 
> Groups "sphinx-users" group.
> > To unsubscribe from this group and stop receiving emails from it, send 
> an email to [email protected].
> > To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sphinx-users/f85679d1-395c-4f05-b342-d844c0225e19n%40googlegroups.com
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"sphinx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sphinx-users/029a0cf7-8ce9-4e1f-9af9-af5fd2c90d4dn%40googlegroups.com.

Reply via email to