Open pique-b opened 1 month ago
Further investigation required, but this seems potentially related to: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_text/Wrapping_breaking_text
@jayaddison Thanks for sharing the link which was quite informative (and fun too). But to my mind, if Sphinx / reST is able to identify a situation when a particular word might overflow and needed to be broken up, why is it that somehow the long string of URL (as shown above) is not broken up, at the point where it tends to overflow
the bounds?
why is it that somehow the long string of URL (as shown above) is not broken up
Possibly because the URL gets transformed into an href
instead of being standard text and thus has to be targeted with custom CSS that might not be implemented.
Possibly because the URL gets transformed into an href instead of being standard text
I find that tweaking a file path a litlle also has the effct as described above. In the example below notice how even a little addition gets in the way of correctly(?) rendering the admonition:
The example:
And in the directive:
.. warning::
WARNING: Notebook exception traceback saved in:
/Users/abcdefghijklmnopqrs/Desktop/PY_PY/py_py_vnv/proj_py_dream/build/html/reports/blame_it_on_rio/imageAI.err.log [mystnb.exec]
WARNING: Notebook exception traceback saved in:
/Users/abcdefghijklmnopqrs/abcdefgh/Desktop/PY_PY/py_py_vnv/proj_py_dream/build/html/reports/blame_it_on_rio/imageAI.err.log [mystnb.exec]
Both are essentially the same, except in the second I added a bunch of random letters /abcdefgh just to see how it played out - but again the second example did overflow the bounds.
Describe the bug
While using admonition warning in my Sphinx doument, I find that a general sentence with a number of words (so as to be longer than the boundary of the admonition to be accommodated) line breaks are enforced once reaching the admonition boundary scope:
An example:
Let's consider the above paragraph itself, the line break has been enforced as we have reached the word/s to be (as in
... (so as to be
(may be different for different screen size and resolution!). Actually what I have experienced is that, Sphinx (RestructuredText) goes a step beyond and is able to add line break if it encounters a word that is comprised of a number of letters and applies the line break by breaking up the word.Whereas if I am to add a longish URL the same effect is not observed (i.e. no line break is applied once the string of texts reaches the admonition's boundary).
Here is an image of what I have described above:
As we can see the URL string has travelled beyond the boundary of the admonition.
How to Reproduce
I have used the minimal settings in my
conf.py
file.The warning directive as being used is reproduced below:
Environment Information
Sphinx extensions
Additional context
So my question is: