1
1
2
- HTML . Special = function ( value ) {
3
- if ( ! ( this instanceof HTML . Special ) )
2
+ HTMLTools . Special = function ( value ) {
3
+ if ( ! ( this instanceof HTMLTools . Special ) )
4
4
// called without `new`
5
- return new HTML . Special ( value ) ;
5
+ return new HTMLTools . Special ( value ) ;
6
6
7
7
this . value = value ;
8
8
} ;
9
- HTML . Special . prototype . toJS = function ( options ) {
9
+ HTMLTools . Special . prototype . toJS = function ( options ) {
10
10
// XXX this is weird because toJS is defined in spacebars-compiler.
11
- // Think about where HTML .Special and toJS should go.
12
- return HTML . Tag . prototype . toJS . call ( { tagName : 'Special' ,
11
+ // Think about where HTMLTools .Special and toJS should go.
12
+ return HTML . Tag . prototype . toJS . call ( { tagName : 'HTMLTools. Special' ,
13
13
attrs : this . value ,
14
14
children : [ ] } ,
15
15
options ) ;
16
16
} ;
17
17
18
- parseFragment = function ( input , options ) {
18
+ HTMLTools . parseFragment = function ( input , options ) {
19
19
var scanner ;
20
20
if ( typeof input === 'string' )
21
21
scanner = new Scanner ( input ) ;
@@ -28,7 +28,7 @@ parseFragment = function (input, options) {
28
28
29
29
// ```
30
30
// { getSpecialTag: function (scanner, templateTagPosition) {
31
- // if (templateTagPosition === HTML .TEMPLATE_TAG_POSITION.ELEMENT) {
31
+ // if (templateTagPosition === HTMLTools .TEMPLATE_TAG_POSITION.ELEMENT) {
32
32
// ...
33
33
// ```
34
34
if ( options && options . getSpecialTag )
@@ -72,7 +72,7 @@ parseFragment = function (input, options) {
72
72
//
73
73
// Adapted from
74
74
// http://stackoverflow.com/questions/7126384/expressing-utf-16-unicode-characters-in-javascript/7126661.
75
- codePointToString = function ( cp ) {
75
+ codePointToString = HTMLTools . codePointToString = function ( cp ) {
76
76
if ( cp >= 0 && cp <= 0xD7FF || cp >= 0xE000 && cp <= 0xFFFF ) {
77
77
return String . fromCharCode ( cp ) ;
78
78
} else if ( cp >= 0x10000 && cp <= 0x10FFFF ) {
@@ -95,7 +95,7 @@ codePointToString = function(cp) {
95
95
}
96
96
} ;
97
97
98
- getContent = function ( scanner , shouldStopFunc ) {
98
+ getContent = HTMLTools . Parse . getContent = function ( scanner , shouldStopFunc ) {
99
99
var items = [ ] ;
100
100
101
101
while ( ! scanner . isEOF ( ) ) {
@@ -123,7 +123,7 @@ getContent = function (scanner, shouldStopFunc) {
123
123
items . push ( HTML . Comment ( token . v ) ) ;
124
124
} else if ( token . t === 'Special' ) {
125
125
// token.v is an object `{ ... }`
126
- items . push ( HTML . Special ( token . v ) ) ;
126
+ items . push ( HTMLTools . Special ( token . v ) ) ;
127
127
} else if ( token . t === 'Tag' ) {
128
128
if ( token . isEnd )
129
129
// we've already screened for `</` so this shouldn't be
@@ -208,7 +208,7 @@ var pushOrAppendString = function (items, string) {
208
208
} ;
209
209
210
210
// get RCDATA to go in the lowercase (or camel case) tagName (e.g. "textarea")
211
- getRCData = function ( scanner , tagName , shouldStopFunc ) {
211
+ getRCData = HTMLTools . Parse . getRCData = function ( scanner , tagName , shouldStopFunc ) {
212
212
var items = [ ] ;
213
213
214
214
while ( ! scanner . isEOF ( ) ) {
@@ -231,7 +231,7 @@ getRCData = function (scanner, tagName, shouldStopFunc) {
231
231
items . push ( convertCharRef ( token ) ) ;
232
232
} else if ( token . t === 'Special' ) {
233
233
// token.v is an object `{ ... }`
234
- items . push ( HTML . Special ( token . v ) ) ;
234
+ items . push ( HTMLTools . Special ( token . v ) ) ;
235
235
} else {
236
236
// (can't happen)
237
237
scanner . fatal ( "Unknown or unexpected token type: " + token . t ) ;
@@ -267,7 +267,7 @@ var getRawText = function (scanner, tagName, shouldStopFunc) {
267
267
pushOrAppendString ( items , token . v ) ;
268
268
} else if ( token . t === 'Special' ) {
269
269
// token.v is an object `{ ... }`
270
- items . push ( HTML . Special ( token . v ) ) ;
270
+ items . push ( HTMLTools . Special ( token . v ) ) ;
271
271
} else {
272
272
// (can't happen)
273
273
scanner . fatal ( "Unknown or unexpected token type: " + token . t ) ;
@@ -319,7 +319,7 @@ var parseAttrs = function (attrs) {
319
319
if ( token . t === 'CharRef' ) {
320
320
outParts . push ( convertCharRef ( token ) ) ;
321
321
} else if ( token . t === 'Special' ) {
322
- outParts . push ( HTML . Special ( token . v ) ) ;
322
+ outParts . push ( HTMLTools . Special ( token . v ) ) ;
323
323
} else if ( token . t === 'Chars' ) {
324
324
pushOrAppendString ( outParts , token . v ) ;
325
325
}
0 commit comments