Skip to content
This repository has been archived by the owner on Jun 21, 2021. It is now read-only.
/ grunt-he Public archive

Grunt task for the javascript HE html entities handling

License

MIT, MIT licenses found

Licenses found

MIT
LICENSE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

mateusnroll/grunt-he

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

grunt-he

Grunt task for the javascript HE html entities handler. For now, it just encodes a string. It's based on mathiasbynens's excelent HE

Getting Started

This plugin requires Grunt ~0.4.5

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

npm install grunt-he --save-dev

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks('grunt-he');

The "he" task

Overview

In your project's Gruntfile, add a section named he to the data object passed into grunt.initConfig().

grunt.initConfig({
  he: {
    options: {
      // Task-specific options go here.
    },
    your_target: {
      // Target-specific file lists and/or options go here.
    },
  },
});

Options

The options for this task can be found at HE's encode text options

Usage Examples

Replace non-entity characters in a HTML file

Replace all the non-entity characters in all HTML files under directory html/to_validate. The final files will be outputted to html/validated.

grunt.initConfig({
  he: {
    options: {
      'useNamedReferences': true,
      'allowUnsafeSymbols': true
    },
    compileMultiple: {
      files: [{
        expand: true,
        cwd: 'html/to_validate',
        src: '**/*.html',
        dest: 'html/validated'
      }]
    }
  },
});

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.

Release History

(Nothing yet)

About

Grunt task for the javascript HE html entities handling

Resources

License

MIT, MIT licenses found

Licenses found

MIT
LICENSE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published