protected String convertCodeBlock(String input) {
   Matcher codeFinder = codeblockPattern.matcher(input);
   String replacement = "{code}{group1}{code}";
   String converted = RegexUtil.loopRegex(codeFinder, input, replacement);
   converted = handleWhitespace(converted);
   return converted;
 }
 /**
  * replaces all whitespace seperating the {code} blocks from the content with just one newline.
  * Example: <br>
  * if input = <br>
  * {code} codeblock {code} <br>
  * <br>
  * then return = <br>
  * {code}<br>
  * codeblock<br>
  * {code}
  *
  * @param input
  * @return
  */
 protected String handleWhitespace(String input) {
   Matcher codeNLFinder = codeNLPattern.matcher(input);
   String replacement = "{group1}\n{group2}\n{group3}";
   return RegexUtil.loopRegex(codeNLFinder, input, replacement);
 }