Git Product home page Git Product logo

html-to-xhtml's Introduction

Java HTML to XHTML Converter

A Java-based pretty-printer and HTML-to-XHTML converter. Sanitizes documents to the best of its ability.

Simply feed this application an input file and it will generate beautified console output (or a file if you modify it), as you wish.

Example

Consider this nice, but slightly malformed HTML file.

<html>
    <head><meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
        <meta name="theme-color" content="#135C39">
<link rel="manifest" href="%PUBLIC_URL%/manifest.json"><title>The Romulus Go-Green Group</title>
</head>
<body>
        <noscript>
    <p>You need to enable <b><i>JavaScript</b></i> to view this site. &reg;</p>
        <p>Please update your browser, and ensure that you don't have any plugins disabling your browser's JavaScript!</p>
        </noscript>
<div id=root></div><div id="volunteer-portal"></div>
    </body>
</html>

An example of the conversion results from the above file.

Notice the few tags that have adjusted and become nested properly now according to the XHTML standard, as well as the corrected document formatting.

Important Note

The generated XHTML from this utility has two output options:

  • Pretty Printed (neat formatting).
  • Minimized.

This is important because the pretty-printed version tends to interfere with document spacing. For example, consider the following HTML:

<b>Item One</b> and a half<b>, Item Two</b>

When this is "pretty-printed", it ends up rendering like so in the XHTML document: Item One and a half , Item Two because the pretty-print feature is separating the line at the boundary and adding the desired spacing.

html-to-xhtml's People

Contributors

notsoanonimus avatar

Watchers

James Cloos avatar  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.