Skip to content

Commit

Permalink
support all HTML tags that can carry source lines, not only DIV elements
Browse files Browse the repository at this point in the history
  • Loading branch information
ahus1 committed Aug 13, 2016
1 parent ba93e9c commit dadc8d9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ window.__IntelliJTools.scrollToLine = (function () {

var scrollToLine = function (newLineToScroll, lineCount) {

// the sourcelines will be as CSS class on div elements only
var blocks = document.getElementsByTagName('div');
// the sourcelines will be as CSS class elements that also have class has-source-line
var blocks = document.getElementsByClassName('has-source-line');
var startY;
var startLine;
var endY;
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/sourceline-treeprocessor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def process document

# on each node add the source file information as role (will result in CSS class in HTML)
if (node.source_location) then
node.attributes['role'] = 'data-line-' + (node.source_location.file || 'stdin') + "-#{node.source_location.lineno}"
node.attributes['role'] = 'has-source-line data-line-' + (node.source_location.file || 'stdin') + "-#{node.source_location.lineno}"
end
end
nil
Expand Down

0 comments on commit dadc8d9

Please sign in to comment.