()
| 255 | } |
| 256 | |
| 257 | func (s *scanner) readText() bool { |
| 258 | s.t.init(text, s.line, s.pos()) |
| 259 | ok := false |
| 260 | for { |
| 261 | if !s.nextByte() { |
| 262 | ok = (len(s.t.Value) > 0) |
| 263 | break |
| 264 | } |
| 265 | if s.c != '{' { |
| 266 | s.appendByte() |
| 267 | continue |
| 268 | } |
| 269 | if !s.nextByte() { |
| 270 | s.appendByte() |
| 271 | ok = true |
| 272 | break |
| 273 | } |
| 274 | if s.c == '%' { |
| 275 | s.nextTokenID = tagName |
| 276 | ok = true |
| 277 | if !s.nextByte() { |
| 278 | s.appendByte() |
| 279 | break |
| 280 | } |
| 281 | if s.c != '-' { |
| 282 | s.unreadByte(s.c) |
| 283 | break |
| 284 | } |
| 285 | s.t.Value = prevBlank.ReplaceAll(s.t.Value, nil) |
| 286 | break |
| 287 | } |
| 288 | s.unreadByte('{') |
| 289 | s.appendByte() |
| 290 | } |
| 291 | if s.stripSpaceDepth > 0 { |
| 292 | s.t.Value = stripSpace(s.t.Value) |
| 293 | } else if s.collapseSpaceDepth > 0 { |
| 294 | s.t.Value = collapseSpace(s.t.Value) |
| 295 | } |
| 296 | return ok |
| 297 | } |
| 298 | |
| 299 | func (s *scanner) readTagName() bool { |
| 300 | s.skipSpace() |
no test coverage detected