MCPcopy Create free account
hub / github.com/sql-js/sql.js / blockText

Function blockText

documentation/javascript/application.js:172–188  ·  view source on GitHub ↗
(block, ignoreNewLines)

Source from the content-addressed store, hash-verified

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+/);

Callers 1

highlightBlockFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…