(boolean stripWhitespace)
| 113 | } |
| 114 | |
| 115 | TemplateElement postParseCleanup(boolean stripWhitespace) { |
| 116 | if (text.length == 0) return this; |
| 117 | int openingCharsToStrip = 0, trailingCharsToStrip=0; |
| 118 | boolean deliberateLeftTrim = deliberateLeftTrim(); |
| 119 | boolean deliberateRightTrim = deliberateRightTrim(); |
| 120 | if (!stripWhitespace || text.length == 0 ) { |
| 121 | return this; |
| 122 | } |
| 123 | if (parent.parent == null && previousSibling() == null) return this; |
| 124 | if (!deliberateLeftTrim) { |
| 125 | trailingCharsToStrip = trailingCharsToStrip(); |
| 126 | } |
| 127 | if (!deliberateRightTrim) { |
| 128 | openingCharsToStrip = openingCharsToStrip(); |
| 129 | } |
| 130 | if (openingCharsToStrip == 0 && trailingCharsToStrip == 0) { |
| 131 | return this; |
| 132 | } |
| 133 | this.text = substring(text, openingCharsToStrip, text.length - trailingCharsToStrip); |
| 134 | if (openingCharsToStrip > 0) { |
| 135 | this.beginLine++; |
| 136 | this.beginColumn = 1; |
| 137 | } |
| 138 | if (trailingCharsToStrip >0) { |
| 139 | this.endColumn = 0; |
| 140 | } |
| 141 | return this; |
| 142 | } |
| 143 | |
| 144 | /** |
| 145 | * Scans forward the nodes on the same line to see whether there is a |
nothing calls this directly
no test coverage detected