aboutsummaryrefslogtreecommitdiff
path: root/javascript/app
diff options
context:
space:
mode:
authoralexwl <alexey.a.kiryushin@gmail.com>2019-02-14 00:54:28 +0300
committeralexwl <alexey.a.kiryushin@gmail.com>2019-02-14 00:54:28 +0300
commitd65f02107a6adce4b45ba9b8ecebf78571612a65 (patch)
treee16036721aed009bc46e56c6aee6c4bd6b701380 /javascript/app
parente8ded03ec40e0ba3d17b9e3e57805ce9afd43534 (diff)
Optimize the process of adding links to Haskell language extension docs
Diffstat (limited to 'javascript/app')
-rw-r--r--javascript/app/components/haskell-module.js17
1 files changed, 10 insertions, 7 deletions
diff --git a/javascript/app/components/haskell-module.js b/javascript/app/components/haskell-module.js
index ee3f7f3..7084510 100644
--- a/javascript/app/components/haskell-module.js
+++ b/javascript/app/components/haskell-module.js
@@ -481,14 +481,17 @@ export default Ember.Component.extend({
const lineCount = lines.length;
let i = 0;
while(i < lineCount) {
- let line = lines.item(i);
- // A file-header pragma must precede the module keyword in the file.
- if(line.innerText.indexOf("module ") === 0) {
- break;
- } else {
- line.innerHTML = addLinksToLanguageExtensionsDocs(line.innerText);
- i = i + 1;
+ const line = lines.item(i);
+ const lineText = line.textContent;
+ if(lineText) {
+ // A file-header pragma must precede the module keyword in the file.
+ if(lineText.indexOf("module ") === 0) {
+ break;
+ } else {
+ line.innerHTML = addLinksToLanguageExtensionsDocs(lineText);
+ }
}
+ i = i + 1;
}
this.element.parentNode.scrollTop = 0;