Index: doc/en/scripterapi-textframes.html
===================================================================
--- doc/en/scripterapi-textframes.html	(revision 26172)
+++ doc/en/scripterapi-textframes.html	(working copy)
@@ -133,8 +133,8 @@
 <p>Relayout the whole text chain whom the text frame "name" belongs. If "name" is not given the currently selected item is used.</p></dd>
 
 <dt><a name="-linkTextFrames"><strong>linkTextFrames</strong></a>(...)</dt>
-<dd><code>linkTextFrames("fromname", "toname")</code>
-<p>Link two text frames. The frame named "fromname" is linked to the frame named "toname". The source frame must not already link to another frame. The target frame must not be linked from another frame.</p>
+<dd><code>linkTextFrames("fromname", "toname", [add_paragraph=True])</code>
+<p>Link two text frames. The frame named "fromname" is linked to the frame named "toname". The source frame must not already link to another frame. The target frame must not be linked from another frame. If "add_paragraph" is omitted or set to True then a paragraph separator is added to the end of the source frame text if needed to prevent a paragraph from crossing the frames, otherwise no such paragraph separator is added.</p>
 <p>May throw <a href="#ScribusException">ScribusException</a> if linking rules are violated.</p></dd>
 
 <dt><a name="-selectFrameText"><strong>selectFrameText</strong></a>(...)</dt>
@@ -246,8 +246,8 @@
 <p>May raise WrongFrameTypeError if the target frame is not an text frame</p></dd>
 
 <dt><a name="-unlinkTextFrames"><strong>unlinkTextFrames</strong></a>(...)</dt>
-<dd><code>unlinkTextFrames("name")</code>
-<p>Remove the specified (named) object from the text frame flow/linkage. If the frame was in the middle of a chain, the previous and next frames will be connected, eg 'a-&gt;b-&gt;c' becomes 'a-&gt;c' when you <a href="#-unlinkTextFrames">unlinkTextFrames</a>(b)'</p>
+<dd><code>unlinkTextFrames("name", [cut_text=False])</code>
+<p>Remove the specified (named) object from the text frame flow/linkage. For example, the chain 'a-&gt;b-&gt;c-&gt;d' becomes the two chains 'a-&gt;b' and 'c-&gt;d' when you <a href="#-unlinkTextFrames">unlinkTextFrames</a>(c). If "cut_text" is set to True the text in the chain is cut to match the new frame linkage, otherwise the text flow ends just before the unlinked frame.</p>
 <p>May throw <a href="#ScribusException">ScribusException</a> if linking rules are violated.</p></dd>
 
 </dl>
Index: scribus/plugins/scriptplugin/cmdtext.cpp
===================================================================
--- scribus/plugins/scriptplugin/cmdtext.cpp	(revision 26172)
+++ scribus/plugins/scriptplugin/cmdtext.cpp	(working copy)
@@ -1319,8 +1319,9 @@
 {
 	PyESString name1;
 	PyESString name2;
+	bool add_paragraph = true;
 
-	if (!PyArg_ParseTuple(args, "eses", "utf-8", name1.ptr(), "utf-8", name2.ptr()))
+	if (!PyArg_ParseTuple(args, "eses", "utf-8", name1.ptr(), "utf-8", name2.ptr(), &add_paragraph))
 		return nullptr;
 	if (!checkHaveDocument())
 		return nullptr;
@@ -1351,7 +1352,7 @@
 		return nullptr;
 	}
 	// references to the others boxes
-	fromItem->link(toItem);
+	fromItem->link(toItem, add_paragraph);
 	ScCore->primaryMainWindow()->view->DrawNew();
 	// enable 'save icon' stuff
 	ScCore->primaryMainWindow()->slotDocCh();
@@ -1362,7 +1363,8 @@
 PyObject *scribus_unlinktextframes(PyObject* /* self */, PyObject* args)
 {
 	PyESString name;
-	if (!PyArg_ParseTuple(args, "es", "utf-8", name.ptr()))
+	bool cut_text = false;
+	if (!PyArg_ParseTuple(args, "es", "utf-8", name.ptr(), &cut_text))
 		return nullptr;
 	if (!checkHaveDocument())
 		return nullptr;
@@ -1399,7 +1401,14 @@
 	for (uint s = 0; s < a2; ++s)
 		item->BackBox->itemText.append(item->itemText.take(0));
 */
-	item->prevInChain()->unlink();
+	if (cut_text)
+	{
+		item->unlinkWithText();
+	}
+	else
+	{
+		item->prevInChain()->unlink();
+	}
 	// enable 'save icon' stuff
 	ScCore->primaryMainWindow()->slotDocCh();
 	ScCore->primaryMainWindow()->view->DrawNew();
