jupyter-book / mystmd

Command line tools for working with MyST Markdown.
https://mystmd.org/guide
MIT License
219 stars 64 forks source link

Image/figure directive align behaviour does not let text float / flow around it #1668

Open anjackson opened 3 days ago

anjackson commented 3 days ago

Description

Under Sphinx/Jupyter Book 1, using left or right alignment on an image or figure causes it to float so that text can flow around it. e.g. this source which comes out like this.

Using a simpler example:

```{image} https://github.com/rowanc1/pics/blob/main/grapes-wide.png?raw=true
:alt: Grapes on a vineyard
:width: 500px
:align: right

test

The current version of MystMD (v1.3.18) appears to generate markup that sets margins so the item pushes to the the right, but it does not float it.

## Proposed solution

Use float for left/right alignment [as under Sphinx](https://docutils.sourceforge.io/docs/ref/rst/directives.html#image) rather than by setting margins.

## Additional notes

❯ myst -v v1.3.18