Add support to flat-table to remove a potential empty paragraph and fix the flat-table iterator#43
Open
tim-nordell-nimbelink wants to merge 2 commits into
Conversation
…vals
Iterating through a list while you're modifying it results an indeterminate
iteration. Instead, copy the original list for the iterator.
An example which doesn't work in Python 3.14 is having this in your flat-table:
.. flat-table::
* - :rspan:`1`:cspan:`1`
versus the following which works in Python 3.14:
.. flat-table::
* - :rspan:`1` :cspan:`1`
The difference is the latter ends up with a node inserted between the rspan
and cspan.
Signed-off-by: Tim Nordell <tnordell@airgain.com>
224af66 to
1086ba4
Compare
This permits a flat-table to have a leading paragraph like this:
.. flat-table::
* - :rspan:`1`
My content here
without injecting an extraneous paragraph on the first line. This syntax
is useful for certain situations where the content comes from a nested
directive like:
.. flat-table::
* - :rspan:`1`
.. directive::
My directive content here
Otherwise the flat-table instance ends up injecting an extra empty paragraph in
this situation. The other place that ends up with extra space in the LaTeX
output is the following situation:
.. flat-table::
* - :rspan:`1`
My text here
This is also solved by trimming leading whitespace on the following sibling of
the element removed.
Examples of trimming in the upstream docutils repository can be seen in [1].
[1] https://github.com/docutils/docutils/blob/c8e6032183c603d1b95fed922952437b24f97f1b/docutils/docutils/transforms/references.py#L734-L745
Signed-off-by: Tim Nordell <tnordell@airgain.com>
1086ba4 to
6beb8f4
Compare
Author
|
Sorry for the churn this morning, but I had discovered one other place in our documents that using the flat-table directive caused extra whitespace in the PDF output, and just needed to tweak it slightly. Notably, the directive case causes extra whites-space in the HTML output whereas the other case mentioned in the commit only causes extra whitespace in the LaTeX/PDF output but not in the HTML output. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Using the flat-table extension we noticed that we end up with an extra empty paragraph when we have this kind of situation:
There are two commits in this series: