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

Custom syntax isn't rendered when indented #418

Open
1 of 3 tasks
florent-leborgne opened this issue Feb 4, 2025 · 12 comments
Open
1 of 3 tasks

Custom syntax isn't rendered when indented #418

florent-leborgne opened this issue Feb 4, 2025 · 12 comments
Labels

Comments

@florent-leborgne
Copy link

Describe the bug

Seen on image blocks and admonitions so far: whenever the block is indented (for example, as part of a list item), it's not rendered in the output. For example:

  • Source:
Image
  • Rendered page:
Image

Expected behavior

The content is properly rendered and indented

Steps to reproduce

No response

Tooling

  • docs-builder
  • migration tooling
  • I'm not sure
@reakaleek
Copy link
Member

Might be fixed by #421

@natasha-moore-elastic
Copy link

Hey @florent-leborgne I noticed the same. When indenting by 2 spaces instead of 4 it works as expected.

@reakaleek, did this fix (#421) apply to bulleted lists only? I'm noticing the same issue with numbered lists. Should I open a separate bug for that?

@reakaleek
Copy link
Member

There is indeed a difference if it's a numberered list

:::::{dropdown}

- List Item 1
- List Item 2
  - Sub List Item 1
  - Sub List Item 2

  Hello, World!
  :::{note}
  Hello, World!
  :::

## What

:::::

:::::{dropdown}

1. List Item 1
2. List Item 2 
   1. Sub List Item 1
   2. Sub List Item 2

  Hello, World!
  :::{note}
  Hello, World!
  :::

## What

:::::

Image

@natasha-moore-elastic
Copy link

Another example I have is

1. From the {{security-app}}, click **Add Integrations**.
2. In the search bar, search for `Threat Intelligence` to get a list of threat intelligence integrations.
3. Select a threat intelligence integration, then complete the integration’s guided installation.

  ::::{note}
  For more information about available fields, go to the [Elastic integration documentation](https://docs.elastic.co/integrations) and search for a specific threat intelligence integration.
  ::::

4. Return to the Indicators page in {{elastic-sec}}. Refresh the page if indicator data isn’t displaying.

renders as

Image

@florent-leborgne
Copy link
Author

florent-leborgne commented Feb 5, 2025

👍 Just refreshed my docs-builder and I can confirm Nat's comments:

  • The issue still appears on ordered list items
  • On unordered list items, it'll only work if the indentation is of 2 spaces - This is worth noting since in many migrated files the default indentation is equivalent to 4 spaces

@reakaleek
Copy link
Member

I just noticed it works on numbered lists if you use 3 spaces.

Input:

1. List Item 1
2. List Item 2
   1. Sub List Item 1
   2. Sub List Item 2

   Hello, World!
   :::{note}
   Hello, World!
   :::

Result:
Image

@reakaleek
Copy link
Member

reakaleek commented Feb 5, 2025

I guess the reason why it's 2 on bullet lists and 3 on numbered lists is, it needs to be aligned with the parent item.

E.g.

1.␣Numbered list item
␣␣␣Content
*␣Bullet list item
␣␣Content

@reakaleek
Copy link
Member

This behaviour seems to be native to MyST. I think the best path forward here, is to create a warning if the spaces don't match the requirement.

WDYT?

@florent-leborgne
Copy link
Author

florent-leborgne commented Feb 5, 2025

And for nested lists, the sub list needs to be 4 spaces behind : ) 3, or 2 won't work. That's a lot to remember

Image

@florent-leborgne
Copy link
Author

I think the best path forward here, is to create a warning if the spaces don't match the requirement.

I'd say it depends:

  • if the risk is that the content isn't rendered (like for custom syntax blocks), a warning isn't sufficient IMO
  • if the risk is just that the final content doesn't actually show proper indentation but is still showing, that's much less of a concern, and a simple warning would do.

@reakaleek
Copy link
Member

reakaleek commented Feb 5, 2025

Btw for nested lists.. I don't think the guideline should be X spaces.

But that it needs to align with the text of the list item.

(At least, this is how I think it works)

@florent-leborgne
Copy link
Author

Sounds good, it'd be good to call this out to writers while we're working on cleaning up our files, as in their migrated state, not everything is aligned out of the box. And many might just think they just need to wait for a full fix :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants