Giter VIP home page Giter VIP logo

jtidy_cfc's Introduction

Introduction

jTidy_cfc is a ColdFusion wrapper for the Java port of HTML Tidy, a HTML syntax checker and pretty printer. Currently using the latest jTidy (jtidy-r938.zip)

Read more: http://jtidy.sourceforge.net/

This version is a fork from mhenke

Modifications from original

  • Removed javaloader as a hard dependency (jar file access is native to Railo 3.2+, you can still use javaloader for ColdFusion server)
  • Updated javaloader to 1.1 (Feb 2012) for those who choose to use it
  • Allowed struct of options to be passed for runtime configuration
  • Updated to use cfscript only
  • Added full var scoping
  • Added option to fail silently or throw on error
  • Added log path argument of where to write errors
  • Removed auto-stripping of header/footer content, use a config option instead
  • Added a character encoding value to options, defaults to UTF8

Requirements

  • Railo 3.2+
  • ColdFusion 9+

Installation

Put the jtidy_cfc folder in your web root (recommended for testing only) or create a mapping pointing to jtidy.cfc

Usage

tidy = new jtidy_cfc.jtidy();

// Simple usage (default options)
validxHTML = tidy.makexHTMLValid(strToParse=mystring);

// Simple usage using javaloader
validxHTML = tidy.makexHTMLValid(strToParse=mystring, useJavaLoader=true);

// Setting custom options
opts = {
    bodyOnly = false,
    spaces = 2
}
validxHTML = tidy.makexHTMLValid(strToParse=mystring, options=opts);

Options

The current options you can pass (see more on the javadoc page):

jOptions = {
    bodyOnly			= true,
    hideComments		= true,
    indentAttributes	= false,
    indentContent 		= true,
    makeBare			= true,
    quiet 				= false,
    smartIndent 		= true,
    spaces				= 4,
    tidyMark			= false,
    wrapLen 			= 1024,
    xhtml 				= true
};
validxHTML = tidy.makexHTMLValid(strToParse=mystring, options=jOptions);

jtidy_cfc's People

Contributors

michaelsharman avatar mhenke avatar

Stargazers

 avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.