(block, ignoreNewLines)
| 170 | } |
| 171 | |
| 172 | function blockText(block, ignoreNewLines) { |
| 173 | var result = ''; |
| 174 | for (var i = 0; i < block.childNodes.length; i++) |
| 175 | if (block.childNodes[i].nodeType == 3) { |
| 176 | var chunk = block.childNodes[i].nodeValue; |
| 177 | if (ignoreNewLines) |
| 178 | chunk = chunk.replace(/\n/g, ''); |
| 179 | result += chunk; |
| 180 | } else if (block.childNodes[i].nodeName == 'BR') |
| 181 | result += '\n'; |
| 182 | else |
| 183 | result += blockText(block.childNodes[i]); |
| 184 | // Thank you, MSIE... |
| 185 | if (/MSIE [678]/.test(navigator.userAgent)) |
| 186 | result = result.replace(/\r/g, '\n'); |
| 187 | return result; |
| 188 | } |
| 189 | |
| 190 | function blockLanguage(block) { |
| 191 | var classes = block.className.split(/\s+/); |
no outgoing calls
no test coverage detected
searching dependent graphs…