Commit ffcb4f7e authored by Brad King's avatar Brad King Committed by Kitware Robot

Merge topic 'rst-bad-markup-block'

a9b38a17 cmRST: Fix crash on empty markup block
20243277 Help: Remove empty literal block markup in RESOURCE target property
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Merge-request: !3197
parents 52fb35bd a9b38a17
Pipeline #134055 passed with stage
in 0 seconds
......@@ -11,7 +11,7 @@ directory (eg. ``Resources`` directory for macOS) inside the bundle.
On non-Apple platforms these files may be installed using the ``RESOURCE``
option to the :command:`install(TARGETS)` command.
Following example of Application Bundle::
Following example of Application Bundle:
.. code-block:: cmake
......
......@@ -457,6 +457,12 @@ void cmRST::UnindentLines(std::vector<std::string>& lines)
size_t trailingEmpty =
std::distance(rit, cmFindNot(cmReverseRange(lines), std::string()));
if ((leadingEmpty + trailingEmpty) >= lines.size()) {
// All lines are empty. The markup block is empty. Leave only one.
lines.resize(1);
return;
}
std::vector<std::string>::iterator contentEnd = cmRotate(
lines.begin(), lines.begin() + leadingEmpty, lines.end() - trailingEmpty);
lines.erase(contentEnd, lines.end());
......
......@@ -83,6 +83,10 @@ or after a paragraph ending in two colons::
but not after a line ending in two colons::
in the middle of a paragraph.
A literal block can be empty::
.. productionlist::
grammar: `production`
production: "content rendered"
......
......@@ -90,6 +90,10 @@ or after a paragraph ending in two colons::
but not after a line ending in two colons::
in the middle of a paragraph.
A literal block can be empty::
.. productionlist::
grammar: `production`
production: "content rendered"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment