Fix regression of single column tables #540
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Single column tables are valid tables, so add back in the accidentally
removed functionality of allowing single column tables, but with one
exception -- table bodies should not render empty.
As discussed in #539, tables with no bodies are given an empty row. This affects both single column tables and multi-column alike.
One side note. PHP extra states that each row should have
|
in single columns. So I enforce that. The reason behind this is how they handle the first pipe in a row. Their consumption logic is a bit different and beyond the scope of this. I added things likePIPE_LEFT
etc. in case we want to address it in the future. The short is that if the header has a leading pipe, the first pipe is stripped. If it doesn't have a leading pipe, the pipe is used on that row as plain text. It isn't described in their spec that I could see, and we didn't support it before, but since it explicitly states you need at least 1 pipe, I enforce that, but leave the possibility to add Extra like pipe consumption enhancements.