Index: trunk/parsers/wikidom/lib/hype/models/es.DocumentModel.js |
— | — | @@ -110,11 +110,13 @@ |
111 | 111 | } |
112 | 112 | // Apply annotation to range |
113 | 113 | if ( src.start < 0 ) { |
114 | | - // TODO: This is invalid data! Throw error? |
| 114 | + // TODO: The start can not be lower than 0! Throw error? |
| 115 | + // Clamp start value |
115 | 116 | src.start = 0; |
116 | 117 | } |
117 | 118 | if ( src.end > data.length ) { |
118 | | - // TODO: This is invalid data! Throw error? |
| 119 | + // TODO: The end can not be higher than the length! Throw error? |
| 120 | + // Clamp end value |
119 | 121 | src.end = data.length; |
120 | 122 | } |
121 | 123 | for ( var i = src.start; i < src.end; i++ ) { |