Class BookmarkId

java.lang.Object
com.scroogexhtml.fields.BookmarkId

public final class BookmarkId extends Object
Maps an RTF bookmark name to an HTML id.

The RTF specification allows any text as a bookmark name (#PCDATA), but an HTML id must not contain whitespace. Every character other than A-Z a-z 0-9 - _ : . becomes _. The bookmark anchor (\bkmkstart) and the internal hyperlink target (HYPERLINK \l "name") use this same mapping, so the link still points to its anchor.

  • Method Details

    • of

      public static String of(String bookmarkName)
      Returns the HTML id for a bookmark name.
      Parameters:
      bookmarkName - the RTF bookmark name
      Returns:
      the name with every character that is not allowed replaced by _