Skip to content

Commit

Permalink
chore(release): Build Dist files
Browse files Browse the repository at this point in the history
  • Loading branch information
JoelParke committed Sep 21, 2015
1 parent f7d34a3 commit 71f3088
Show file tree
Hide file tree
Showing 4 changed files with 153 additions and 47 deletions.
33 changes: 25 additions & 8 deletions dist/textAngular-sanitize.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,13 @@ var START_TAG_REGEXP =
BEGIN_TAG_REGEXP = /^</,
BEGING_END_TAGE_REGEXP = /^<\//,
COMMENT_REGEXP = /<!--(.*?)-->/g,
SINGLE_COMMENT_REGEXP = /(^<!--.*?-->)/,
DOCTYPE_REGEXP = /<!DOCTYPE([^>]*?)>/i,
CDATA_REGEXP = /<!\[CDATA\[(.*?)]]>/g,
SURROGATE_PAIR_REGEXP = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g,
// Match everything outside of normal chars and " (quote character)
NON_ALPHANUMERIC_REGEXP = /([^\#-~| |!])/g;
NON_ALPHANUMERIC_REGEXP = /([^\#-~| |!])/g,
WHITE_SPACE_REGEXP = /^(\s+)/;


// Good source of info about elements and attributes
Expand Down Expand Up @@ -288,14 +290,23 @@ function htmlParser(html, handler) {
// Make sure we're not in a script or style element
if (!stack.last() || !specialElements[ stack.last() ]) {

// Comment
if (html.indexOf("<!--") === 0) {
// comments containing -- are not allowed unless they terminate the comment
index = html.indexOf("--", 4);
// White space
if (WHITE_SPACE_REGEXP.test(html)) {
match = html.match(WHITE_SPACE_REGEXP);

if (index >= 0 && html.lastIndexOf("-->", index) === index) {
if (handler.comment) handler.comment(html.substring(4, index));
html = html.substring(index + 3);
if (match) {
var mat = match[0];
if (handler.whitespace) handler.whitespace(match[0]);
html = html.replace(match[0], '');
chars = false;
}
//Comment
} else if (SINGLE_COMMENT_REGEXP.test(html)) {
match = html.match(SINGLE_COMMENT_REGEXP);

if (match) {
if (handler.comment) handler.comment(match[1]);
html = html.replace(match[0], '');
chars = false;
}
// DOCTYPE
Expand Down Expand Up @@ -587,6 +598,12 @@ function htmlSanitizeWriter(buf, uriValidator) {
out(unary ? '/>' : '>');
}
},
comment: function (com) {
out(com);
},
whitespace: function (ws) {
out(encodeEntities(ws));
},
end: function(tag) {
tag = angular.lowercase(tag);
if (!ignore && validElements[tag] === true) {
Expand Down
2 changes: 1 addition & 1 deletion dist/textAngular-sanitize.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 71f3088

Please sign in to comment.