Class YoutubeDescriptionHelper


  • public final class YoutubeDescriptionHelper
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String attributedDescriptionToHtml​(com.grack.nanojson.JsonObject attributedDescription)
      Parse a video description in the new "attributed" format, which contains the entire visible plaintext (content) and an array of commandRuns and styleRuns.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • attributedDescriptionToHtml

        @Nullable
        public static java.lang.String attributedDescriptionToHtml​(@Nullable
                                                                   com.grack.nanojson.JsonObject attributedDescription)
        Parse a video description in the new "attributed" format, which contains the entire visible plaintext (content) and an array of commandRuns and styleRuns. Returns the formatted content in HTML format, and escapes the text to make sure there are no XSS attacks.

        commandRuns include the links and their range in the text, while styleRuns include the styling to apply to various ranges in the text.

        Parameters:
        attributedDescription - the JSON object of the attributed description
        Returns:
        the parsed description, in HTML format, as a string