Commits

Lynn Rees committed 75c57e5

- rich text join in progress...

  • Participants
  • Parent commits 7170e52

Comments (0)

Files changed (11)

 	<classpathentry combineaccessrules="false" exported="true" kind="src" path="/JOrtho_0.4_freeplane"/>
 	<classpathentry exported="true" kind="con" path="GROOVY_SUPPORT"/>
 	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	<classpathentry kind="output" path="scripts"/>
+	<classpathentry kind="output" path="bin"/>
 </classpath>

File part/_joinChars.groovy

-def mark = ui.showInputDialog(
-	node.delegate, 'Enter characters to join nodes with...', ''
-)
-if (mark != null) {
-	joinText(mark ? mark : '')
-}
+pick(ui.showInputDialog(node.delegate, 'Enter characters to join nodes with...', ''))

File part/_joinComma.groovy

-joinText(', ')
+pick(', ')

File part/_joinPeriod.groovy

-joinText('. ')
+pick('. ')

File part/_joinSpace.groovy

-joinText(' ')
+pick(' ')

File scripts/joinChars.groovy

 // @CacheScriptContent(true)
 // @ExecutionModes({ON_SINGLE_NODE})
 import org.apache.commons.lang.StringUtils as SU
+import org.freeplane.core.util.HtmlUtils as HU
 
-def joinText(String mark) {
-    node.text = SU.join(
-		c.selecteds.collect { SU.trim(it.plainText) }.toArray(), mark
-	)
-    c.selecteds.tail().each { it.delete() }
+def joinPlain(String mark) {
+	node.text = SU.join(
+			c.selecteds.collect { SU.trim(it.plainText) }.toArray(), mark
+			)
+	c.selecteds.tail().each { it.delete() }
 }
 
-def mark = ui.showInputDialog(
-	node.delegate, 'Enter characters to join nodes with...', ''
-)
-if (mark != null) {
-	joinText(mark ? mark : '')
+def joinAll(String mark) {
+	// core text
+	def core, coreMarkup
+	def cores = []
+	def coreHtml = false
+	def coreHtmlNode = false
+	// note text
+	def note, noteMarkup
+	def notes = []
+	def noteHtml = false
+	def noteHtmlNode = false
+	// details text
+	def detail, detailMarkup
+	def details = []
+	def detailHtml = false
+	def detailHtmlNode = false
+	// all children
+	def children = []
+	// all icons
+	def icons = []
+
+	// classify
+	c.selecteds.each { n ->
+		// core text
+		if (n.text != null ) {
+			core = n.text
+			coreHtmlNode = HU.isHtmlNode(core)
+			cores.add(core)
+			coreHtml = coreHtml || coreHtmlNode
+		}
+		// note text
+		if (n.note != null) {
+			note = n.noteText
+			noteHtmlNode = HU.isHtmlNode(note)
+			notes.add(note)
+			noteHtml = noteHtml || noteHtmlNode
+		}
+		if (n.details != null) {
+			// detail text
+			detail = n.detailsText
+			detailHtmlNode = HU.isHtmlNode(detail)
+			details.add(detail)
+			detailHtml = detailHtml || detailHtmlNode
+		}
+		// children
+		if (!n.children.empty()) {
+			children.addAll(n.children)
+		}
+		// icons
+		if (n.icons != null) {
+			icons.addAll(n.icons?.icons)
+		}
+	}
+
+	def tmpMarkup, writer, body
+
+	// core texts
+	if (!cores.empty()) {
+		// core texts with HTML
+		if (coreHtml) {
+			coreMarkup = new XmlParser().parseText('<html><body></body></html>')
+			body = coreMarkup.body
+			cores.each {
+				tmpMarkup = new XmlParser().parseText(it)
+				tmpMarkup.body.each { part ->
+					body?.appendNode(part)
+					body?.appendNode(mark)
+				}
+			}
+			writer = new StringWriter()
+			new XmlNodePrinter(new PrintWriter(writer)).print(coreMarkup)
+			node.text = writer.toString()
+			// core texts without
+		} else {
+			node.text = SU.join(cores.toArray(), mark)
+		}
+	}
+
+	// notes
+	if (!notes.empty()) {
+		// notes with HTML
+		if (noteHtml) {
+			noteMarkup = new XmlParser().parseText('<html><body></body></html>')
+			body = noteMarkup.body
+			notes.each {
+				tmpMarkup = new XmlParser().parseText(it)
+				tmpMarkup.body.each { part ->
+					body?.appendNode(part)
+					body?.appendNode(mark)
+				}
+			}
+			writer = new StringWriter()
+			new XmlNodePrinter(new PrintWriter(writer)).print(noteMarkup)
+			node.noteText = writer.toString()
+			// notes without
+		} else {
+			node.noteText = SU.join(notes.toArray(), mark)
+		}
+	}
+
+	// details
+	if (!details.empty()) {
+		// details with HTML
+		if (detailHtml) {
+			detailMarkup = new XmlParser().parseText('<html><body></body></html>')
+			body = detailMarkup.body
+			details.each {
+				tmpMarkup = new XmlParser().parseText(it)
+				tmpMarkup.body.each { part ->
+					body?.appendNode(part)
+					body?.appendNode(mark)
+				}
+			}
+			writer = new StringWriter()
+			new XmlNodePrinter(new PrintWriter(writer)).print(detailMarkup)
+			node.detailsText = writer.toString()
+			// details without
+		} else {
+			node.detailsText = SU.join(details.toArray(), mark)
+		}
+	}
+
+	// icons
+	if (!icons.empty()) {
+		node.icons?.icons?.clear()
+		icons.each { node.icons.add(it) }
+	}
+	// children
+	if (!children.empty()) {
+		children.each { node.appendChild(it) }
+	}
+
+	// cleanup
+	c.selecteds.tail().each { it.delete() }
+
+	// present
+	c.select(node)
+	c.centerOnNode(node)
 }
+
+def pick(String mark) {
+	if (mark != null) {
+		mark = mark ? mark : ''
+		if (Boolean.parseBoolean(config.getProperty('wikd_plain_text'))) {
+			joinPlain(mark)
+		} else {
+			joinAll(mark)
+		}
+	}
+}
+pick(ui.showInputDialog(node.delegate, 'Enter characters to join nodes with...', ''))

File scripts/joinComma.groovy

 // @CacheScriptContent(true)
 // @ExecutionModes({ON_SINGLE_NODE})
 import org.apache.commons.lang.StringUtils as SU
+import org.freeplane.core.util.HtmlUtils as HU
 
-def joinText(String mark) {
-    node.text = SU.join(
-		c.selecteds.collect { SU.trim(it.plainText) }.toArray(), mark
-	)
-    c.selecteds.tail().each { it.delete() }
+def joinPlain(String mark) {
+	node.text = SU.join(
+			c.selecteds.collect { SU.trim(it.plainText) }.toArray(), mark
+			)
+	c.selecteds.tail().each { it.delete() }
 }
 
-joinText(', ')
+def joinAll(String mark) {
+	// core text
+	def core, coreMarkup
+	def cores = []
+	def coreHtml = false
+	def coreHtmlNode = false
+	// note text
+	def note, noteMarkup
+	def notes = []
+	def noteHtml = false
+	def noteHtmlNode = false
+	// details text
+	def detail, detailMarkup
+	def details = []
+	def detailHtml = false
+	def detailHtmlNode = false
+	// all children
+	def children = []
+	// all icons
+	def icons = []
+
+	// classify
+	c.selecteds.each { n ->
+		// core text
+		if (n.text != null ) {
+			core = n.text
+			coreHtmlNode = HU.isHtmlNode(core)
+			cores.add(core)
+			coreHtml = coreHtml || coreHtmlNode
+		}
+		// note text
+		if (n.note != null) {
+			note = n.noteText
+			noteHtmlNode = HU.isHtmlNode(note)
+			notes.add(note)
+			noteHtml = noteHtml || noteHtmlNode
+		}
+		if (n.details != null) {
+			// detail text
+			detail = n.detailsText
+			detailHtmlNode = HU.isHtmlNode(detail)
+			details.add(detail)
+			detailHtml = detailHtml || detailHtmlNode
+		}
+		// children
+		if (!n.children.empty()) {
+			children.addAll(n.children)
+		}
+		// icons
+		if (n.icons != null) {
+			icons.addAll(n.icons?.icons)
+		}
+	}
+
+	def tmpMarkup, writer, body
+
+	// core texts
+	if (!cores.empty()) {
+		// core texts with HTML
+		if (coreHtml) {
+			coreMarkup = new XmlParser().parseText('<html><body></body></html>')
+			body = coreMarkup.body
+			cores.each {
+				tmpMarkup = new XmlParser().parseText(it)
+				tmpMarkup.body.each { part ->
+					body?.appendNode(part)
+					body?.appendNode(mark)
+				}
+			}
+			writer = new StringWriter()
+			new XmlNodePrinter(new PrintWriter(writer)).print(coreMarkup)
+			node.text = writer.toString()
+			// core texts without
+		} else {
+			node.text = SU.join(cores.toArray(), mark)
+		}
+	}
+
+	// notes
+	if (!notes.empty()) {
+		// notes with HTML
+		if (noteHtml) {
+			noteMarkup = new XmlParser().parseText('<html><body></body></html>')
+			body = noteMarkup.body
+			notes.each {
+				tmpMarkup = new XmlParser().parseText(it)
+				tmpMarkup.body.each { part ->
+					body?.appendNode(part)
+					body?.appendNode(mark)
+				}
+			}
+			writer = new StringWriter()
+			new XmlNodePrinter(new PrintWriter(writer)).print(noteMarkup)
+			node.noteText = writer.toString()
+			// notes without
+		} else {
+			node.noteText = SU.join(notes.toArray(), mark)
+		}
+	}
+
+	// details
+	if (!details.empty()) {
+		// details with HTML
+		if (detailHtml) {
+			detailMarkup = new XmlParser().parseText('<html><body></body></html>')
+			body = detailMarkup.body
+			details.each {
+				tmpMarkup = new XmlParser().parseText(it)
+				tmpMarkup.body.each { part ->
+					body?.appendNode(part)
+					body?.appendNode(mark)
+				}
+			}
+			writer = new StringWriter()
+			new XmlNodePrinter(new PrintWriter(writer)).print(detailMarkup)
+			node.detailsText = writer.toString()
+			// details without
+		} else {
+			node.detailsText = SU.join(details.toArray(), mark)
+		}
+	}
+
+	// icons
+	if (!icons.empty()) {
+		node.icons?.icons?.clear()
+		icons.each { node.icons.add(it) }
+	}
+	// children
+	if (!children.empty()) {
+		children.each { node.appendChild(it) }
+	}
+
+	// cleanup
+	c.selecteds.tail().each { it.delete() }
+
+	// present
+	c.select(node)
+	c.centerOnNode(node)
+}
+
+def pick(String mark) {
+	if (mark != null) {
+		mark = mark ? mark : ''
+		if (Boolean.parseBoolean(config.getProperty('wikd_plain_text'))) {
+			joinPlain(mark)
+		} else {
+			joinAll(mark)
+		}
+	}
+}
+pick(', ')

File scripts/joinPeriod.groovy

 // @CacheScriptContent(true)
 // @ExecutionModes({ON_SINGLE_NODE})
 import org.apache.commons.lang.StringUtils as SU
+import org.freeplane.core.util.HtmlUtils as HU
 
-def joinText(String mark) {
-    node.text = SU.join(
-		c.selecteds.collect { SU.trim(it.plainText) }.toArray(), mark
-	)
-    c.selecteds.tail().each { it.delete() }
+def joinPlain(String mark) {
+	node.text = SU.join(
+			c.selecteds.collect { SU.trim(it.plainText) }.toArray(), mark
+			)
+	c.selecteds.tail().each { it.delete() }
 }
 
-joinText('. ')
+def joinAll(String mark) {
+	// core text
+	def core, coreMarkup
+	def cores = []
+	def coreHtml = false
+	def coreHtmlNode = false
+	// note text
+	def note, noteMarkup
+	def notes = []
+	def noteHtml = false
+	def noteHtmlNode = false
+	// details text
+	def detail, detailMarkup
+	def details = []
+	def detailHtml = false
+	def detailHtmlNode = false
+	// all children
+	def children = []
+	// all icons
+	def icons = []
+
+	// classify
+	c.selecteds.each { n ->
+		// core text
+		if (n.text != null ) {
+			core = n.text
+			coreHtmlNode = HU.isHtmlNode(core)
+			cores.add(core)
+			coreHtml = coreHtml || coreHtmlNode
+		}
+		// note text
+		if (n.note != null) {
+			note = n.noteText
+			noteHtmlNode = HU.isHtmlNode(note)
+			notes.add(note)
+			noteHtml = noteHtml || noteHtmlNode
+		}
+		if (n.details != null) {
+			// detail text
+			detail = n.detailsText
+			detailHtmlNode = HU.isHtmlNode(detail)
+			details.add(detail)
+			detailHtml = detailHtml || detailHtmlNode
+		}
+		// children
+		if (!n.children.empty()) {
+			children.addAll(n.children)
+		}
+		// icons
+		if (n.icons != null) {
+			icons.addAll(n.icons?.icons)
+		}
+	}
+
+	def tmpMarkup, writer, body
+
+	// core texts
+	if (!cores.empty()) {
+		// core texts with HTML
+		if (coreHtml) {
+			coreMarkup = new XmlParser().parseText('<html><body></body></html>')
+			body = coreMarkup.body
+			cores.each {
+				tmpMarkup = new XmlParser().parseText(it)
+				tmpMarkup.body.each { part ->
+					body?.appendNode(part)
+					body?.appendNode(mark)
+				}
+			}
+			writer = new StringWriter()
+			new XmlNodePrinter(new PrintWriter(writer)).print(coreMarkup)
+			node.text = writer.toString()
+			// core texts without
+		} else {
+			node.text = SU.join(cores.toArray(), mark)
+		}
+	}
+
+	// notes
+	if (!notes.empty()) {
+		// notes with HTML
+		if (noteHtml) {
+			noteMarkup = new XmlParser().parseText('<html><body></body></html>')
+			body = noteMarkup.body
+			notes.each {
+				tmpMarkup = new XmlParser().parseText(it)
+				tmpMarkup.body.each { part ->
+					body?.appendNode(part)
+					body?.appendNode(mark)
+				}
+			}
+			writer = new StringWriter()
+			new XmlNodePrinter(new PrintWriter(writer)).print(noteMarkup)
+			node.noteText = writer.toString()
+			// notes without
+		} else {
+			node.noteText = SU.join(notes.toArray(), mark)
+		}
+	}
+
+	// details
+	if (!details.empty()) {
+		// details with HTML
+		if (detailHtml) {
+			detailMarkup = new XmlParser().parseText('<html><body></body></html>')
+			body = detailMarkup.body
+			details.each {
+				tmpMarkup = new XmlParser().parseText(it)
+				tmpMarkup.body.each { part ->
+					body?.appendNode(part)
+					body?.appendNode(mark)
+				}
+			}
+			writer = new StringWriter()
+			new XmlNodePrinter(new PrintWriter(writer)).print(detailMarkup)
+			node.detailsText = writer.toString()
+			// details without
+		} else {
+			node.detailsText = SU.join(details.toArray(), mark)
+		}
+	}
+
+	// icons
+	if (!icons.empty()) {
+		node.icons?.icons?.clear()
+		icons.each { node.icons.add(it) }
+	}
+	// children
+	if (!children.empty()) {
+		children.each { node.appendChild(it) }
+	}
+
+	// cleanup
+	c.selecteds.tail().each { it.delete() }
+
+	// present
+	c.select(node)
+	c.centerOnNode(node)
+}
+
+def pick(String mark) {
+	if (mark != null) {
+		mark = mark ? mark : ''
+		if (Boolean.parseBoolean(config.getProperty('wikd_plain_text'))) {
+			joinPlain(mark)
+		} else {
+			joinAll(mark)
+		}
+	}
+}
+pick('. ')

File scripts/joinSpace.groovy

 // @CacheScriptContent(true)
 // @ExecutionModes({ON_SINGLE_NODE})
 import org.apache.commons.lang.StringUtils as SU
+import org.freeplane.core.util.HtmlUtils as HU
 
-def joinText(String mark) {
-    node.text = SU.join(
-		c.selecteds.collect { SU.trim(it.plainText) }.toArray(), mark
-	)
-    c.selecteds.tail().each { it.delete() }
+def joinPlain(String mark) {
+	node.text = SU.join(
+			c.selecteds.collect { SU.trim(it.plainText) }.toArray(), mark
+			)
+	c.selecteds.tail().each { it.delete() }
 }
 
-joinText(' ')
+def joinAll(String mark) {
+	// core text
+	def core, coreMarkup
+	def cores = []
+	def coreHtml = false
+	def coreHtmlNode = false
+	// note text
+	def note, noteMarkup
+	def notes = []
+	def noteHtml = false
+	def noteHtmlNode = false
+	// details text
+	def detail, detailMarkup
+	def details = []
+	def detailHtml = false
+	def detailHtmlNode = false
+	// all children
+	def children = []
+	// all icons
+	def icons = []
+
+	// classify
+	c.selecteds.each { n ->
+		// core text
+		if (n.text != null ) {
+			core = n.text
+			coreHtmlNode = HU.isHtmlNode(core)
+			cores.add(core)
+			coreHtml = coreHtml || coreHtmlNode
+		}
+		// note text
+		if (n.note != null) {
+			note = n.noteText
+			noteHtmlNode = HU.isHtmlNode(note)
+			notes.add(note)
+			noteHtml = noteHtml || noteHtmlNode
+		}
+		if (n.details != null) {
+			// detail text
+			detail = n.detailsText
+			detailHtmlNode = HU.isHtmlNode(detail)
+			details.add(detail)
+			detailHtml = detailHtml || detailHtmlNode
+		}
+		// children
+		if (!n.children.empty()) {
+			children.addAll(n.children)
+		}
+		// icons
+		if (n.icons != null) {
+			icons.addAll(n.icons?.icons)
+		}
+	}
+
+	def tmpMarkup, writer, body
+
+	// core texts
+	if (!cores.empty()) {
+		// core texts with HTML
+		if (coreHtml) {
+			coreMarkup = new XmlParser().parseText('<html><body></body></html>')
+			body = coreMarkup.body
+			cores.each {
+				tmpMarkup = new XmlParser().parseText(it)
+				tmpMarkup.body.each { part ->
+					body?.appendNode(part)
+					body?.appendNode(mark)
+				}
+			}
+			writer = new StringWriter()
+			new XmlNodePrinter(new PrintWriter(writer)).print(coreMarkup)
+			node.text = writer.toString()
+			// core texts without
+		} else {
+			node.text = SU.join(cores.toArray(), mark)
+		}
+	}
+
+	// notes
+	if (!notes.empty()) {
+		// notes with HTML
+		if (noteHtml) {
+			noteMarkup = new XmlParser().parseText('<html><body></body></html>')
+			body = noteMarkup.body
+			notes.each {
+				tmpMarkup = new XmlParser().parseText(it)
+				tmpMarkup.body.each { part ->
+					body?.appendNode(part)
+					body?.appendNode(mark)
+				}
+			}
+			writer = new StringWriter()
+			new XmlNodePrinter(new PrintWriter(writer)).print(noteMarkup)
+			node.noteText = writer.toString()
+			// notes without
+		} else {
+			node.noteText = SU.join(notes.toArray(), mark)
+		}
+	}
+
+	// details
+	if (!details.empty()) {
+		// details with HTML
+		if (detailHtml) {
+			detailMarkup = new XmlParser().parseText('<html><body></body></html>')
+			body = detailMarkup.body
+			details.each {
+				tmpMarkup = new XmlParser().parseText(it)
+				tmpMarkup.body.each { part ->
+					body?.appendNode(part)
+					body?.appendNode(mark)
+				}
+			}
+			writer = new StringWriter()
+			new XmlNodePrinter(new PrintWriter(writer)).print(detailMarkup)
+			node.detailsText = writer.toString()
+			// details without
+		} else {
+			node.detailsText = SU.join(details.toArray(), mark)
+		}
+	}
+
+	// icons
+	if (!icons.empty()) {
+		node.icons?.icons?.clear()
+		icons.each { node.icons.add(it) }
+	}
+	// children
+	if (!children.empty()) {
+		children.each { node.appendChild(it) }
+	}
+
+	// cleanup
+	c.selecteds.tail().each { it.delete() }
+
+	// present
+	c.select(node)
+	c.centerOnNode(node)
+}
+
+def pick(String mark) {
+	if (mark != null) {
+		mark = mark ? mark : ''
+		if (Boolean.parseBoolean(config.getProperty('wikd_plain_text'))) {
+			joinPlain(mark)
+		} else {
+			joinAll(mark)
+		}
+	}
+}
+pick(' ')

File shared/join.groovy

 import org.apache.commons.lang.StringUtils as SU
+import org.freeplane.core.util.HtmlUtils as HU
 
-def joinText(String mark) {
-    node.text = SU.join(
-		c.selecteds.collect { SU.trim(it.plainText) }.toArray(), mark
-	)
-    c.selecteds.tail().each { it.delete() }
+def joinPlain(String mark) {
+	node.text = SU.join(
+			c.selecteds.collect { SU.trim(it.plainText) }.toArray(), mark
+			)
+	c.selecteds.tail().each { it.delete() }
 }
+
+def joinAll(String mark) {
+	// core text
+	def core, coreMarkup
+	def cores = []
+	def coreHtml = false
+	def coreHtmlNode = false
+	// note text
+	def note, noteMarkup
+	def notes = []
+	def noteHtml = false
+	def noteHtmlNode = false
+	// details text
+	def detail, detailMarkup
+	def details = []
+	def detailHtml = false
+	def detailHtmlNode = false
+	// all children
+	def children = []
+	// all icons
+	def icons = []
+
+	// classify
+	c.selecteds.each { n ->
+		// core text
+		if (n.text != null ) {
+			core = n.text
+			coreHtmlNode = HU.isHtmlNode(core)
+			cores.add(core)
+			coreHtml = coreHtml || coreHtmlNode
+		}
+		// note text
+		if (n.note != null) {
+			note = n.noteText
+			noteHtmlNode = HU.isHtmlNode(note)
+			notes.add(note)
+			noteHtml = noteHtml || noteHtmlNode
+		}
+		if (n.details != null) {
+			// detail text
+			detail = n.detailsText
+			detailHtmlNode = HU.isHtmlNode(detail)
+			details.add(detail)
+			detailHtml = detailHtml || detailHtmlNode
+		}
+		// children
+		//if (!n.children.empty()) {
+		//	children.addAll(n.children)
+		//}
+		// icons
+		if (n.icons != null) {
+			icons.addAll(n.icons?.icons)
+		}
+	}
+
+	def tmpMarkup, writer, body
+
+	// core texts
+	if (cores.size() > 0) {
+		// core texts with HTML
+		if (coreHtml) {
+			coreMarkup = new XmlParser().parseText(
+					'<html><head></head><body></body></html>'
+					)
+			head = coreMarkup.head[0]
+			body = coreMarkup.body[0]
+			cores.each {
+				if (HU.isHtmlNode(it)) {
+					tmpMarkup = new XmlParser().parseText(it)
+					if (tmpMarkup.head) {
+						tmpMarkup.head?.children().each { part ->
+							head.append(part.clone())
+						}
+					}
+					tmpMarkup.body[0].children().each { part ->
+						body.append(part.clone())
+						body.appendNode('span', mark)
+					}
+				} else if (SU.trim(it) != '') {
+					body.appendNode('span', it)
+					body.appendNode('span', mark)
+				}
+			}
+			writer = new StringWriter()
+			new XmlNodePrinter(new PrintWriter(writer)).print(coreMarkup)
+			node.text = writer.toString()
+			// core texts without
+		} else {
+			node.text = SU.join(cores.toArray(), mark)
+		}
+	}
+
+	// notes
+	if (notes.size() > 0) {
+		// notes with HTML
+		if (noteHtml) {
+			noteMarkup = new XmlParser().parseText(
+					'<html><head></head><body></body></html>'
+					)
+			body = noteMarkup.body[0]
+			ui.informationMessage(body.toString())
+			notes.each {
+				tmpMarkup = new XmlParser().parseText(it)
+				tmpMarkup.body[0].children().each { part -> body.append(part) }
+			}
+			writer = new StringWriter()
+			new XmlNodePrinter(new PrintWriter(writer)).print(noteMarkup)
+			node.noteText = writer.toString()
+			// notes without
+		} else {
+			node.noteText = SU.join(notes.toArray(), mark)
+		}
+	}
+
+	// details
+	if (details.size() > 0) {
+		// details with HTML
+		if (detailHtml) {
+			detailMarkup = new XmlParser().parseText('<html><head></head><body></body></html>')
+			body = detailMarkup.body[0]
+			details.each {
+				tmpMarkup = new XmlParser().parseText(it)
+				tmpMarkup.body[0].children().each { part -> body.append(part) }
+			}
+			writer = new StringWriter()
+			new XmlNodePrinter(new PrintWriter(writer)).print(detailMarkup)
+			node.detailsText = writer.toString()
+			// details without
+		} else {
+			node.detailsText = SU.join(details.toArray(), mark)
+		}
+	}
+
+	// icons
+	if (icons.size() > 0) {
+		def ikons = node.icons
+		ikons?.icons?.every { ikons?.remove(it) }
+		icons.every { ikons?.add(it) }
+	}
+	// children
+	//if (!children.empty()) {
+	//	children.each { node.appendChild(it) }
+	//}*/
+
+	// cleanup
+	c.selecteds.toList().tail().every { it.delete() }
+
+	// present
+	c.select(node)
+	c.centerOnNode(node)
+}
+
+def pick(String mark) {
+	if (mark != null) {
+		mark = mark ? mark : ''
+		if (Boolean.parseBoolean(config.getProperty('wikd_plain_text'))) {
+			joinPlain(mark)
+		} else {
+			joinAll(mark)
+		}
+	}
+}
 <map version="freeplane 1.2.0">
 <!--To view this file, download free mind mapping software Freeplane from http://freeplane.sourceforge.net -->
-<node TEXT="wikdNode" FOLDED="false" ID="ID_1723255651" CREATED="1283093380553" MODIFIED="1359741188156" BACKGROUND_COLOR="#97c7dc" LINK="https://bitbucket.org/lcrees/wikdnode/">
+<node TEXT="wikdNode" FOLDED="false" ID="ID_1723255651" CREATED="1283093380553" MODIFIED="1359787765817" BACKGROUND_COLOR="#97c7dc" LINK="https://bitbucket.org/lcrees/wikdnode/">
 <font SIZE="16" BOLD="true" ITALIC="true"/>
 <hook NAME="MapStyle">
     <properties show_icon_for_attributes="true" show_note_icons="true"/>
 <hook NAME="AutomaticEdgeColor" COUNTER="6"/>
 <attribute_layout NAME_WIDTH="103" VALUE_WIDTH="103"/>
 <attribute NAME="name" VALUE="wikdNode"/>
-<attribute NAME="version" VALUE="v0.6.5" OBJECT="org.freeplane.features.format.FormattedObject|v0.6.5|number:decimal:#0.####"/>
+<attribute NAME="version" VALUE="v0.7.0" OBJECT="org.freeplane.features.format.FormattedObject|v0.7.0|number:decimal:#0.####"/>
 <attribute NAME="author" VALUE="L. C. Rees"/>
 <attribute NAME="freeplaneVersionFrom" VALUE="1.2.15"/>
 <attribute NAME="freeplaneVersionTo" VALUE=""/>
     </ul>
   </body>
 </html>
+
 </richcontent>
 <hook NAME="FlexibleLayout" VALUE="CHILDREN"/>
-<node TEXT="description" POSITION="left" ID="ID_143630176" CREATED="1357715826843" MODIFIED="1359702112182">
+<node TEXT="description" POSITION="left" ID="ID_143630176" CREATED="1357715826843" MODIFIED="1359787765826">
 <edge COLOR="#ff0000"/>
 <richcontent TYPE="NOTE">
 
     </p>
   </body>
 </html>
+
 </richcontent>
 <attribute_layout NAME_WIDTH="100" VALUE_WIDTH="100"/>
 <node ID="ID_419235551" CREATED="1357715987721" MODIFIED="1358826414218"><richcontent TYPE="NODE">
 <attribute_layout NAME_WIDTH="100" VALUE_WIDTH="100"/>
 </node>
 </node>
-<node TEXT="changes" POSITION="left" ID="ID_1790870178" CREATED="1357715826877" MODIFIED="1359702112184">
+<node TEXT="changes" POSITION="left" ID="ID_1790870178" CREATED="1357715826877" MODIFIED="1359787765827">
 <edge COLOR="#0000ff"/>
 <richcontent TYPE="NOTE">
 
     </p>
   </body>
 </html>
+
 </richcontent>
 <attribute_layout NAME_WIDTH="100" VALUE_WIDTH="100"/>
 <node TEXT="0.3.0" ID="ID_1041388750" CREATED="1358051551048" MODIFIED="1358051563586">
 </node>
 </node>
 </node>
-<node TEXT="license" POSITION="left" ID="ID_1348143779" CREATED="1357715826886" MODIFIED="1359702112186">
+<node TEXT="license" POSITION="left" ID="ID_1348143779" CREATED="1357715826886" MODIFIED="1359787765829">
 <edge COLOR="#00ff00"/>
 <richcontent TYPE="NOTE">
 
     </p>
   </body>
 </html>
+
 </richcontent>
 <attribute_layout NAME_WIDTH="100" VALUE_WIDTH="100"/>
 <node TEXT="This add-on is free software: you can redistribute it and/or modify&#xa;it under the terms of the GNU General Public License as published by&#xa;the Free Software Foundation, either version 2 of the License, or&#xa;(at your option) any later version.&#xa;&#xa;This program is distributed in the hope that it will be useful,&#xa;but WITHOUT ANY WARRANTY; without even the implied warranty of&#xa;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the&#xa;GNU General Public License for more details." ID="ID_241792435" CREATED="1357715826895" MODIFIED="1357719017976">
 <attribute_layout NAME_WIDTH="100" VALUE_WIDTH="100"/>
 </node>
 </node>
-<node TEXT="preferences.xml" POSITION="left" ID="ID_1772733941" CREATED="1357715826946" MODIFIED="1359702112189">
+<node TEXT="preferences.xml" POSITION="left" ID="ID_1772733941" CREATED="1357715826946" MODIFIED="1359787765831">
 <edge COLOR="#ff00ff"/>
 <richcontent TYPE="NOTE">
 
     </p>
   </body>
 </html>
+
 </richcontent>
 <attribute_layout NAME_WIDTH="100" VALUE_WIDTH="100"/>
-<node TEXT="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#xa;&lt;preferences_structure&gt;&#xa;&lt;tabbed_pane&gt;&#xa;&lt;tab name=&quot;plugins&quot;&gt;&#xa;&lt;separator name=&quot;wikd&quot;&gt;&#xa;&lt;boolean name=&quot;wikd_first_split&quot; /&gt;&#xa;&lt;/separator&gt;&#xa;&lt;/tab&gt;&#xa;&lt;/tabbed_pane&gt;&#xa;&lt;/preferences_structure&gt;" ID="ID_873595672" CREATED="1358304692163" MODIFIED="1358308194898">
+<node TEXT="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#xa;&lt;preferences_structure&gt;&#xa;&lt;tabbed_pane&gt;&#xa;&lt;tab name=&quot;plugins&quot;&gt;&#xa;&lt;separator name=&quot;wikd&quot;&gt;&#xa;&lt;boolean name=&quot;wikd_first_split&quot; /&gt;&#xa;&lt;boolean name=&quot;wikd_plain_text&quot; /&gt;&#xa;&lt;/separator&gt;&#xa;&lt;/tab&gt;&#xa;&lt;/tabbed_pane&gt;&#xa;&lt;/preferences_structure&gt;" ID="ID_873595672" CREATED="1358304692163" MODIFIED="1359786929814">
 <attribute_layout NAME_WIDTH="100" VALUE_WIDTH="100"/>
 </node>
 </node>
-<node TEXT="default.properties" POSITION="left" ID="ID_1954124232" CREATED="1357715826968" MODIFIED="1359702112190">
+<node TEXT="default.properties" POSITION="left" ID="ID_1954124232" CREATED="1357715826968" MODIFIED="1359787765832">
 <edge COLOR="#00ffff"/>
 <richcontent TYPE="NOTE">
 
     </p>
   </body>
 </html>
+
 </richcontent>
-<attribute_layout NAME_WIDTH="72" VALUE_WIDTH="72"/>
+<attribute_layout NAME_WIDTH="74" VALUE_WIDTH="74"/>
 <attribute NAME="wikd_first_split" VALUE="false"/>
+<attribute NAME="wikd_plain_text" VALUE="false"/>
 </node>
-<node TEXT="translations" POSITION="left" ID="ID_1430168348" CREATED="1357715826977" MODIFIED="1359702112192">
+<node TEXT="translations" POSITION="left" ID="ID_1430168348" CREATED="1357715826977" MODIFIED="1359787765834">
 <edge COLOR="#ffff00"/>
 <richcontent TYPE="NOTE">
 
     </p>
   </body>
 </html>
+
 </richcontent>
 <attribute_layout NAME_WIDTH="100" VALUE_WIDTH="100"/>
-<node TEXT="en" ID="ID_1245393964" CREATED="1357715826986" MODIFIED="1359702348835">
-<attribute_layout NAME_WIDTH="130" VALUE_WIDTH="246"/>
+<node TEXT="en" ID="ID_1245393964" CREATED="1357715826986" MODIFIED="1359787012582">
+<attribute_layout NAME_WIDTH="132" VALUE_WIDTH="258"/>
 <attribute NAME="addons.${name}" VALUE="wikdNode"/>
 <attribute NAME="wikdConvert" VALUE="Convert"/>
 <attribute NAME="wikdDelete" VALUE="Delete"/>
 <attribute NAME="wikd.deleteLinks" VALUE="Delete links"/>
 <attribute NAME="OptionPanel.separator.wikd" VALUE="wikdNode"/>
 <attribute NAME="OptionPanel.wikd_first_split" VALUE="Keep first split as parent"/>
+<attribute NAME="OptionPanel.wikd_plain_text" VALUE="Always join node core, note, or details text as plain text"/>
 </node>
-<node TEXT="de" ID="ID_726128733" CREATED="1357715826986" MODIFIED="1359702440779">
-<attribute_layout NAME_WIDTH="130" VALUE_WIDTH="224"/>
+<node TEXT="de" ID="ID_726128733" CREATED="1357715826986" MODIFIED="1359787048875">
+<attribute_layout NAME_WIDTH="132" VALUE_WIDTH="313"/>
 <attribute NAME="addons.${name}" VALUE="wikdNode"/>
 <attribute NAME="wikdConvert" VALUE="Konvertieren"/>
 <attribute NAME="wikdDelete" VALUE="Entfernen"/>
 <attribute NAME="wikd.deleteLinks" VALUE="Entferne Links"/>
 <attribute NAME="OptionPanel.separator.wikd" VALUE="wikdNode"/>
 <attribute NAME="OptionPanel.wikd_first_split" VALUE="Halten erste Spaltung als Elternknoten"/>
+<attribute NAME="OptionPanel.wikd_plain_text" VALUE="Immer Verbindungsknoten Kern, Notiz oder Details Text als Klartext"/>
 </node>
 </node>
-<node TEXT="deinstall" POSITION="left" ID="ID_1844997656" CREATED="1357715826998" MODIFIED="1359702113669">
+<node TEXT="deinstall" POSITION="left" ID="ID_1844997656" CREATED="1357715826998" MODIFIED="1359787765835">
 <edge COLOR="#7c0000"/>
 <richcontent TYPE="NOTE">
 
     </p>
   </body>
 </html>
+
 </richcontent>
 <attribute_layout NAME_WIDTH="30" VALUE_WIDTH="269"/>
 <attribute NAME="delete" VALUE="${installationbase}/addons/${name}.script.xml"/>
 <attribute NAME="delete" VALUE="${installationbase}/scripts/splitAfterChars.groovy"/>
 <attribute NAME="delete" VALUE="${installationbase}/scripts/splitAfterRegex.groovy"/>
 </node>
-<node TEXT="scripts" POSITION="right" ID="ID_1324856264" CREATED="1357715827025" MODIFIED="1359702112203">
+<node TEXT="scripts" POSITION="right" ID="ID_1324856264" CREATED="1357715827025" MODIFIED="1359787765841">
 <edge COLOR="#00007c"/>
 <richcontent TYPE="NOTE">
 
     </p>
   </body>
 </html>
+
 </richcontent>
 <attribute_layout NAME_WIDTH="100" VALUE_WIDTH="100"/>
 <node TEXT="capitalize.groovy" ID="ID_1501046977" CREATED="1357794199593" MODIFIED="1358028490172">
 <attribute NAME="execute_scripts_without_network_restriction" VALUE="false"/>
 </node>
 </node>
-<node TEXT="zips" POSITION="right" ID="ID_269135974" CREATED="1357715827053" MODIFIED="1359702112300">
+<node TEXT="zips" POSITION="right" ID="ID_269135974" CREATED="1357715827053" MODIFIED="1359787765854">
 <edge COLOR="#007c00"/>
 <richcontent TYPE="NOTE">
 
     </p>
   </body>
 </html>
+
 </richcontent>
 <attribute_layout NAME_WIDTH="100" VALUE_WIDTH="100"/>
 </node>
-<node TEXT="images" FOLDED="true" POSITION="right" ID="ID_112966804" CREATED="1357715827065" MODIFIED="1359702112304">
+<node TEXT="images" FOLDED="true" POSITION="right" ID="ID_112966804" CREATED="1357715827065" MODIFIED="1359787765857">
 <edge COLOR="#7c007c"/>
 <richcontent TYPE="NOTE">
 
     </p>
   </body>
 </html>
+
 </richcontent>
 <attribute_layout NAME_WIDTH="100" VALUE_WIDTH="100"/>
 <node TEXT="${name}.png" ID="ID_473909841" CREATED="1357854883609" MODIFIED="1357866785018">