sakaiproject/nakamura — pull request #741 by zathomas (2012-04-16 05:51:05+00:00)
Title: KERN-2766 migration: some migrated elements out of order

This one turned out to be trickier than I expected. The issue is how you place blocks of html when there is a widget in the middle of the block.

Hello there

Here we have some text in a paragraph followed by an image as a widget. Once we've extracted the widget from this tag, we have no way of knowing whether "Hello there" is supposed to go before it or after it.

My fix is to replace the widget tag with `%%xxxx%%` and then split on `%%`. The `String[]` I get back from that tells me where that widget had been relative to the element text

If the text comes before the widget, I take that opportunity to place an htmlblock.