Mermaid page alignment

When adding a mermaid to the markdown, the diagram would be left-aligned and a white box would be used as the background and will fill all the width of the screen, and if the mermaid code is indented under some list, the white box starts at correct left position, but it will fill the rest of the page.

I would like to suggest to have the box to only fit the diagram. This way there is no left-aligned diagram and no long and ugly while background box.: