()
| 326 | } |
| 327 | |
| 328 | func (s *scanner) readTagContents() bool { |
| 329 | s.skipSpace() |
| 330 | s.t.init(tagContents, s.line, s.pos()) |
| 331 | for { |
| 332 | if s.c != '%' { |
| 333 | s.appendByte() |
| 334 | if !s.nextByte() { |
| 335 | return false |
| 336 | } |
| 337 | continue |
| 338 | } |
| 339 | if !s.nextByte() { |
| 340 | s.appendByte() |
| 341 | return false |
| 342 | } |
| 343 | if s.c == '}' { |
| 344 | if bytes.HasSuffix(s.t.Value, []byte("-")) { |
| 345 | s.t.Value = s.t.Value[:len(s.t.Value)-1] |
| 346 | s.stripToNewLine = true |
| 347 | } |
| 348 | s.nextTokenID = text |
| 349 | s.t.Value = stripTrailingSpace(s.t.Value) |
| 350 | return true |
| 351 | } |
| 352 | s.unreadByte('%') |
| 353 | s.appendByte() |
| 354 | if !s.nextByte() { |
| 355 | return false |
| 356 | } |
| 357 | } |
| 358 | } |
| 359 | |
| 360 | func (s *scanner) skipSpace() { |
| 361 | for s.nextByte() && s.isSpace() { |
no test coverage detected