Class HtmlUtils

java.lang.Object
org.eblocker.server.common.util.HtmlUtils

public class HtmlUtils extends Object
  • Method Details

    • insertBeforeBodyEnd

      public static String insertBeforeBodyEnd(String html, String inlay)
      Inserts the inlay fragment at the end of the <body> content.

      end-of-body may be implicit as a closing tag may be omitted and correctly doing so requires parsing the dom. To avoid this it is assumed it is closed by (in that order):

      • explicit: </body>
      • implicit: </html>
      • implicit by end-of-file

      More details on omitting closing body and html tags:

      • https://developer.mozilla.org/en-US/docs/Web/HTML/Element/body
      • https://developer.mozilla.org/en-US/docs/Web/HTML/Element/html
    • insertBeforeBodyEnd

      public static void insertBeforeBodyEnd(StringBuilder html, String inlay)
      Inserts the inlay fragment at the end of the <body> content.

      end-of-body may be implicit as a closing tag may be omitted and correctly doing so requires parsing the dom. To avoid this it is assumed it is closed by (in that order):

      • explicit: </body>
      • implicit: </html>

      More details on omitting closing body and html tags:

      • https://developer.mozilla.org/en-US/docs/Web/HTML/Element/body
      • https://developer.mozilla.org/en-US/docs/Web/HTML/Element/html