JTidySupport

JTidy HTML Pretty Pringing Support

The JTidy library is a library providing html parsing and pretty printing capabilities.

HTML editor currenly provides only indentation not real reformatting or pretty printing. Moreover there are almost no configuration options (except the indent level) which one could use to adjust the way how the code is reformatted.

The JTidy library allows to customize the way how to html code is reformatted.

There's already a netbeans library for the JTidy in visualweb.libs.jtidy module.

The process

  • Identify how can be JTidy used by the pretty printing of html code
    • It's apparent we cannot simply replace the selected code by the output stream from jtidy, it needs to be diffed and just the diff changes applied back to the document. Otherwise the editor positions and hence annotations would be moved the the beginnging of the reformatted section.
    • Find out how JTidy deals with templating languages.
    • There seems to be some support for at least ignoring the templating sections (ASP, PHP ...)
  • Create a UI for html options where user can configure the jtidy pretty printing options.
  • Move the netbeans jtidy library to libs.jtidy module
Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo