File tree 5 files changed +11
-12
lines changed
5 files changed +11
-12
lines changed Original file line number Diff line number Diff line change @@ -122,7 +122,7 @@ var getDoctypeQuotedString = function (scanner) {
122
122
//
123
123
// If `getDocType` sees "<!DOCTYPE" (case-insensitive), it will match or fail fatally.
124
124
getDoctype = function ( scanner ) {
125
- if ( HTML . asciiLowerCase ( scanner . rest ( ) . slice ( 0 , 9 ) ) !== '<!doctype' )
125
+ if ( HTMLTools . asciiLowerCase ( scanner . rest ( ) . slice ( 0 , 9 ) ) !== '<!doctype' )
126
126
return null ;
127
127
var start = scanner . pos ;
128
128
scanner . pos += 9 ;
@@ -141,7 +141,7 @@ getDoctype = function (scanner) {
141
141
name += ch ;
142
142
scanner . pos ++ ;
143
143
}
144
- name = HTML . asciiLowerCase ( name ) ;
144
+ name = HTMLTools . asciiLowerCase ( name ) ;
145
145
146
146
// Now we're looking at a space or a `>`.
147
147
skipSpaces ( scanner ) ;
@@ -154,7 +154,7 @@ getDoctype = function (scanner) {
154
154
// but we're not looking at space or `>`.
155
155
156
156
// this should be "public" or "system".
157
- var publicOrSystem = HTML . asciiLowerCase ( scanner . rest ( ) . slice ( 0 , 6 ) ) ;
157
+ var publicOrSystem = HTMLTools . asciiLowerCase ( scanner . rest ( ) . slice ( 0 , 6 ) ) ;
158
158
159
159
if ( publicOrSystem === 'system' ) {
160
160
scanner . pos += 6 ;
Original file line number Diff line number Diff line change 1
1
2
2
HTMLTools = { } ;
3
3
4
- var asciiLowerCase = HTML . asciiLowerCase ;
4
+ var asciiLowerCase = HTMLTools . asciiLowerCase = function ( str ) {
5
+ return str . replace ( / [ A - Z ] / g, function ( c ) {
6
+ return String . fromCharCode ( c . charCodeAt ( 0 ) + 32 ) ;
7
+ } ) ;
8
+ } ;
5
9
6
10
var svgCamelCaseAttributes = 'attributeName attributeType baseFrequency baseProfile calcMode clipPathUnits contentScriptType contentStyleType diffuseConstant edgeMode externalResourcesRequired filterRes filterUnits glyphRef glyphRef gradientTransform gradientTransform gradientUnits gradientUnits kernelMatrix kernelUnitLength kernelUnitLength kernelUnitLength keyPoints keySplines keyTimes lengthAdjust limitingConeAngle markerHeight markerUnits markerWidth maskContentUnits maskUnits numOctaves pathLength patternContentUnits patternTransform patternUnits pointsAtX pointsAtY pointsAtZ preserveAlpha preserveAspectRatio primitiveUnits refX refY repeatCount repeatDur requiredExtensions requiredFeatures specularConstant specularExponent specularExponent spreadMethod spreadMethod startOffset stdDeviation stitchTiles surfaceScale surfaceScale systemLanguage tableValues targetX targetY textLength textLength viewBox viewTarget xChannelSelector yChannelSelector zoomAndPan' . split ( ' ' ) ;
7
11
Original file line number Diff line number Diff line change @@ -69,9 +69,9 @@ Tinytest.add("htmljs - construction", function (test) {
69
69
Tinytest . add ( "htmljs - utils" , function ( test ) {
70
70
71
71
test . notEqual ( "\u00c9" . toLowerCase ( ) , "\u00c9" ) ;
72
- test . equal ( HTML . asciiLowerCase ( "\u00c9" ) , "\u00c9" ) ;
72
+ test . equal ( HTMLTools . asciiLowerCase ( "\u00c9" ) , "\u00c9" ) ;
73
73
74
- test . equal ( HTML . asciiLowerCase ( "Hello There" ) , "hello there" ) ;
74
+ test . equal ( HTMLTools . asciiLowerCase ( "Hello There" ) , "hello there" ) ;
75
75
76
76
test . isTrue ( HTML . isVoidElement ( "br" ) ) ;
77
77
test . isFalse ( HTML . isVoidElement ( "div" ) ) ;
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ Package.on_use(function (api) {
10
10
11
11
Package . on_test ( function ( api ) {
12
12
api . use ( 'htmljs' ) ;
13
+ api . use ( 'html-tools' ) ;
13
14
api . use ( 'tinytest' ) ;
14
15
api . use ( 'underscore' ) ;
15
16
api . add_files ( [ 'htmljs_test.js' ] ) ;
Original file line number Diff line number Diff line change @@ -17,12 +17,6 @@ HTML.isNully = function (node) {
17
17
return false ;
18
18
} ;
19
19
20
- HTML . asciiLowerCase = function ( str ) {
21
- return str . replace ( / [ A - Z ] / g, function ( c ) {
22
- return String . fromCharCode ( c . charCodeAt ( 0 ) + 32 ) ;
23
- } ) ;
24
- } ;
25
-
26
20
HTML . escapeData = function ( str ) {
27
21
// string; escape the two special chars in HTML data and RCDATA
28
22
return str . replace ( / & / g, '&' ) . replace ( / < / g, '<' ) ;
You can’t perform that action at this time.
0 commit comments