Skip to content

Commit

Permalink
Optimize the process of adding links to Haskell language extension docs
Browse files Browse the repository at this point in the history
  • Loading branch information
alexwl committed Feb 13, 2019
1 parent e8ded03 commit d65f021
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 15 deletions.
17 changes: 10 additions & 7 deletions javascript/app/components/haskell-module.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit d65f021

Please sign in to comment.