Skip to content

Commit 986efbd

Browse files
committed
added mergeHtml
1 parent 0b64c52 commit 986efbd

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

Tutorial-o-Matic/src/main/groovy/ToM_ui.groovy

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ import org.freeplane.core.ui.components.UITools as ui
3535

3636
import io.github.gitbucket.markedj.Marked
3737
import io.github.gitbucket.markedj.Options
38+
39+
import org.jsoup.Jsoup
40+
import org.jsoup.nodes.Document
41+
3842
//end:
3943

4044
class ToM_ui{
@@ -155,6 +159,14 @@ class ToM_ui{
155159
return html
156160
}
157161

162+
def static mergeHtml(baseHtml, addedHtml){
163+
if(!baseHtml) return addedHtml
164+
if(!addedHtml) return baseHtml
165+
Document doc = Jsoup.parse(baseHtml)
166+
doc.body().append('<p/>').append(addedHtml)
167+
return doc.html()
168+
}
169+
158170
//end:
159171

160172
//region: creating panes

0 commit comments

Comments
 (0)