private static String formatHtml ( final CommandLine commandLine , final String plainCow , final String moosage , final boolean isThought ) { String cow = plainCow ; if ( commandLine . hasOption ( CowsayCli . Opt . HTML . toString ( ) ) ) { cow = StringEscapeUtils . escapeHtml4 ( cow ) ; cow = "<figure><pre>" + cow + "</pre><figcaption style=\"left:-999px; position:absolute\">" ; String alt ; if ( commandLine . hasOption ( CowsayCli . Opt . ALT . toString ( ) ) ) { alt = commandLine . getOptionValue ( CowsayCli . Opt . ALT . toString ( ) ) ; } else { alt = isThought ? I18n . getMessage ( "altthink" ) : I18n . getMessage ( "altsay" ) ; } String escaped = StringEscapeUtils . escapeHtml4 ( moosage ) ; cow += String . format ( alt , escaped ) ; cow += "</figcaption></figure>" ; } return cow ; }
May apply HTML markup to the cow if requested in the command line .