PHP Classes

File: public/assets/bower_components/bootstrap-colorpicker/docs/helpers/code/index.js

Recommend this page to a friend!
  Classes of Abed Nego Ragil Putra   PHP Inventory Management System with Scanner   public/assets/bower_components/bootstrap-colorpicker/docs/helpers/code/index.js   Download  
File: public/assets/bower_components/bootstrap-colorpicker/docs/helpers/code/index.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: PHP Inventory Management System with Scanner
Manage inventory stock using scanner application
Author: By
Last change:
Date: 1 year ago
Size: 590 bytes
 

Contents

Class file image Download
var beautify = require('js-beautify').html; var entityMap = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': '&quot;', "'": '&#39;', "/": '&#x2F;' }; module.exports.register = function (Handlebars, options) { Handlebars.registerHelper('code', function (hboptions) { var codeStr = beautify(String(hboptions.fn(this)).trim(), { "wrap_line_length": 80, "wrap_attributes": "auto", "indent_scripts": "normal" }).replace(/[&<>"'\/]/g, function (s) { return entityMap[s]; }); return '<div class="example-code">' + codeStr + '</div>'; }); };