Exemple #1
0
static void help( ctmbstr prog )
{
    printf( "%s [option...] [file...] [option...] [file...]\n", prog );
    printf( "Utility to clean up and pretty print HTML/XHTML/XML\n");
    printf( "See http://tidy.sourceforge.net/\n");
    printf( "\n");

#ifdef PLATFORM_NAME
    printf( "Options for HTML Tidy for %s released on %s:\n",
             PLATFORM_NAME, tidyReleaseDate() );
#else
    printf( "Options for HTML Tidy released on %s:\n", tidyReleaseDate() );
#endif
    printf( "\n");

    print_help_option();

    printf( "Use --optionX valueX for any configuration option \"optionX\" with argument\n"
            "\"valueX\". For a list of the configuration options, use \"-help-config\" or refer\n"
            "to the man page.\n\n");

    printf( "Input/Output default to stdin/stdout respectively.\n");
    printf( "Single letter options apart from -f may be combined\n");
    printf( "as in:  tidy -f errs.txt -imu foo.html\n");
    printf( "For further info on HTML see http://www.w3.org/MarkUp\n");
    printf( "\n");
}
Exemple #2
0
static void version( void )
{
#ifdef PLATFORM_NAME
    printf( "HTML Tidy for %s released on %s\n",
             PLATFORM_NAME, tidyReleaseDate() );
#else
    printf( "HTML Tidy released on %s\n", tidyReleaseDate() );
#endif
}
Exemple #3
0
static void XMLoptionhelp( TidyDoc tdoc )
{
    printf( "<?xml version=\"1.0\"?>\n"
            "<config version=\"%s\">\n", tidyReleaseDate());
    ForEachOption( tdoc, printXMLOption );
    printf( "</config>\n" );
}
Exemple #4
0
static void xml_help( void )
{
    printf( "<?xml version=\"1.0\"?>\n"
            "<cmdline version=\"%s\">\n", tidyReleaseDate());
    print_xml_help_option();
    printf( "</cmdline>\n" );
}
Exemple #5
0
/* {{{ proto string tidy_get_release()
   Get release date (version) for Tidy library */
static PHP_FUNCTION(tidy_get_release)
{
	if (zend_parse_parameters_none() == FAILURE) {
		return;
	}

	RETURN_STRING((char *)tidyReleaseDate());
}
Exemple #6
0
static PHP_MINFO_FUNCTION(tidy)
{
	php_info_print_table_start();
	php_info_print_table_header(2, "Tidy support", "enabled");
	php_info_print_table_row(2, "libTidy Release", (char *)tidyReleaseDate());
	php_info_print_table_row(2, "Extension Version", PHP_TIDY_VERSION " ($Id: 7a4a7e7d6a3b11be5f7a6f87e82eda4723a0208f $)");
	php_info_print_table_end();

	DISPLAY_INI_ENTRIES();
}
Exemple #7
0
static PHP_MINFO_FUNCTION(tidy)
{
	php_info_print_table_start();
	php_info_print_table_header(2, "Tidy support", "enabled");
	php_info_print_table_row(2, "libTidy Release", (char *)tidyReleaseDate());
	php_info_print_table_row(2, "Extension Version", PHP_TIDY_VERSION " ($Id: cdda540586e209c347c9a8c68fc07bbc615d8435 $)");
	php_info_print_table_end();

	DISPLAY_INI_ENTRIES();
}
Exemple #8
0
// Tidy changed TidyBodyOnly type from bool to int at 2007-05-24.
// Returns true when a new version (int) is found
bool isTidyWithIntBodyOnlyCheck() {
  QString releaseDateStr(tidyReleaseDate());
  int yearPos = releaseDateStr.indexOf(QRegExp(" [0-9]{4}"));
  if (yearPos != -1)
    releaseDateStr = releaseDateStr.left(yearPos + 5);
  QDate releaseDate = QLocale::c().toDate(releaseDateStr, "d MMMM yyyy");
  if (releaseDate.isNull())
    releaseDate = QLocale::c().toDate(releaseDateStr, "yyyy/MM/dd");
  QDate changeDate = QLocale::c().toDate("24 May 2007", "d MMMM yyyy");
  bool isNewer = releaseDate > changeDate;

#ifdef DEBUG_MARKUP
  qDebug() << "\n[DEBUG] tidy release date:" << releaseDate.toString(Qt::ISODate);
  qDebug() << "\n[DEBUG] use API with new TidyBodyOnly as int :" << isNewer;
#endif

  return isNewer;
}
int main (int argc, char **argv)
{
    TidyIterator pos;
    TidyDoc tdoc;
    int count;
    count = 0;

    tdoc = tidyCreate();    
    pos = tidyGetOptionList( tdoc );
    test (pos != 0, & count, "got a tdoc");
    while (1) {
        TidyOption to;
        TidyOptionType tot;
        const char * name;
        const char * option_default;
        int option_default_int;
        Bool option_default_bool;
        to = tidyGetNextOption(tdoc, &pos);
        if (to == 0) {
            break;
        }
        name = tidyOptGetName(to);
        test(name != 0, &count, "name is not null");
        tot = tidyOptGetType(to);
        if (name) {
            test(is_short_ascii_no_ws(name), &count, "name looks OK");
            printf("# %s %d\n", name, tot);
        }
        switch (tot) {
        case TidyString:
            test(1, &count, "got a good opt type");
            option_default = tidyOptGetDefault(to);
            //null seems to be allowed.
            //test (option_default != 0, & count, "string default is not null");
            if (option_default) {
                test(is_short_ascii_no_ws(option_default), &count,
                    "looks like a reasonable default string");
                printf("# %s default value is '%s'.\n", name, option_default);
            }
            break;
        case TidyInteger:
            test(1, &count, "got a good opt type");
            option_default_int = tidyOptGetDefaultInt(to);
            test(abs(option_default_int) < crazy_number, &count,
                "default number doesn't look strange");
            printf("# Integer type default value %d\n", option_default_int);
            break;
        case TidyBoolean:
            test(1, &count, "got a good opt type");
            option_default_bool = tidyOptGetDefaultInt(to);
            test(option_default_bool == 0 || option_default_bool == 1,
                &count, "boolean default is 0 or 1");
            printf("# boolean = %d\n", option_default_bool);
            break;
        default:
            test(0, &count, "got a good opt type");
            printf("# Unknown value for option type %d.\n", tot);
        }
    }
    // TAP plan
    printf ("1..%d\n", count);
    printf("\nTest used libtidy version %s, dated %s\n", tidyLibraryVersion(), tidyReleaseDate());
    if (argc > 1) {
        printf("\n Note this `test-get-options` app v.%s, date %s, does not take any commands!\n", TT_VERSION, TT_DATE);
        show_help();
        return 1;
    }

    return 0;
}