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

Tables with cells that contain block elements #291

Open
2 of 3 tasks
colleenmcginnis opened this issue Jan 22, 2025 · 2 comments
Open
2 of 3 tasks

Tables with cells that contain block elements #291

colleenmcginnis opened this issue Jan 22, 2025 · 2 comments
Labels

Comments

@colleenmcginnis
Copy link

colleenmcginnis commented Jan 22, 2025

Related to #112 (comment) (but opening a new issue for visibility)

Describe the bug

I'm seeing a couple issue with tables, but probably the most concerning is when an AsciiDoc table contains cells that contain multiple block elements. I don't necessarily think we should support this in docs-builder, but we should definitely have a plan for handling these situations because it's a pretty common pattern across docs, and it makes content very difficult to read.

Example: Cells containing admonitions

AsciiDoc doc-builder
Image
Link
Image
Link

To get a sense of the scope of this issue, you can search some AsciiDoc docs for (^| )a\| (though that probably won't capture all of the cells). Here's what I got when I checked a few repos:

  • elastic/elasticsearch: 10 mentions in 4 files
  • elastic/kibana: 102 mentions in 12 files
  • elastic/observability-docs: 211 mentions in 29 files

If we want writers to simplify tables and/or un-table-ify content in complex tables more broadly, we can use this regular expression to capture more formatted cells in AsciiDoc files: ( |^)((\d+)|(\.\d+)|(\+|\*)|([\^\.<>]+)|(a|d|e|h|l|m|s))+\|. This should catch spanning columns/rows, duplicating cells, and formatting cells.

Expected behavior

See above...

Steps to reproduce

See above for examples and ways to search for additional affected tables.

Tooling

  • docs-builder
  • migration tooling
  • I'm not sure
@colleenmcginnis
Copy link
Author

We'll also need to make sure we remove any line breaks inside table cells:

Image

Local link

@colleenmcginnis
Copy link
Author

Also, if you're using block elements in table cells, internal links are also not migrated like here:

Image

@bmorelli25 bmorelli25 mentioned this issue Jan 21, 2025
9 tasks
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

1 participant