Skip to content

Commit dadc8d9

Browse files
committed
support all HTML tags that can carry source lines, not only DIV elements
1 parent ba93e9c commit dadc8d9

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/main/resources/org/asciidoc/intellij/editor/javafx/scrollToElement.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ window.__IntelliJTools.scrollToLine = (function () {
2424

2525
var scrollToLine = function (newLineToScroll, lineCount) {
2626

27-
// the sourcelines will be as CSS class on div elements only
28-
var blocks = document.getElementsByTagName('div');
27+
// the sourcelines will be as CSS class elements that also have class has-source-line
28+
var blocks = document.getElementsByClassName('has-source-line');
2929
var startY;
3030
var startLine;
3131
var endY;

src/main/resources/sourceline-treeprocessor.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def process document
1010

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

0 commit comments

Comments
 (0)