symfony-tools/docs-builder

Issue when parsing code blocks inside list items

javiereguiluz opened this issue · 5 comments

In this article --> https://raw.githubusercontent.com/EasyCorp/EasyAdminBundle/master/doc/upgrade.rst we have this:

Removed Features
----------------

EasyAdmin 3 removes some features of the previous versions which are no longer
considered useful:

* The ``design.brand_color`` config option has been removed because you can't
  customize the backend design by changing just this value. If you still want to
  do that, use the following code in your dashboard class::

      class DashboardController extends AbstractDashboardController
      {
          // ...

          public function configureAssets(): Assets
          {
              return Assets::new()
                  // ...
                  ->addHtmlContentToHead('<style>:root { --color-primary: #123456; }</style>');
          }
      }

* The ``default: true`` option to set the default backend page has been removed.
  Use the :doc:`dashboard </dashboards>` index as the default page or redirect
  to the desired page inside the dashboard controller action.

In the current symfony.com it works OK:

image

But the new parser doesn't understand it:

image

We might consider this "won't fix because it's too edgy" and then rewrite the original RST content.

Unfortunately, this is a lot bigger than just the literal blocks. The current rst parser only parses inline markup (strong, emphasis, etc) in the contents of a list. This means that any markup that is not inline (or "span" as they call it in rst parser) is broken, e.g:

* list item

  .. note::

      This is a note

We're also using these markups in some occasions of the Symfony docs, so this is a bit of a big blocker.

isn't that related?
doctrine/rst-parser#86

@nikophil yes it is. Thanks for mentioning it!

My first expectation was that the rst parser doesn't allow parsing nested block elements, but I just found fragment parsing in the table. So I hope this is now easier to fix, by also parsing the fragment of the list item. I'll see if I can manage creating a PR here :)

@javiereguiluz that PR was about definition lists, not normal lists. I'll make a PR for normal lists (fixing this issue) later today