Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
out = open(sys.argv[3], "w")

for l in inf:
if (l.find("rfcdiff.js") != -1):
if (l.find('<script src="rfcdiff.js"></script>') != -1):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My argument against this change is that it will not properly rewrite a script line that is an absolute URL to a site. Is your plan to instead have some sort of conditional statement in the script?

out.write(" <script>\n")
for l2 in js:
out.write(l2)
Expand Down
4 changes: 2 additions & 2 deletions rfcdiff.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function format_chunk(index) {
}

function find_chunk(n){
return document.querySelector('a[name$="' + n + '"]');
return document.querySelector('tr[id$="' + n + '"]');
}

function change_chunk(offset) {
Expand All @@ -27,7 +27,7 @@ function change_chunk(offset) {
if (old_chunk) {
old_chunk.style.outline = "";
}
old_chunk = new_chunk.parentNode.parentNode;
old_chunk = new_chunk;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hadn't noticed that there was an ID. This is fine but you could just do
"getElementById()" or at least not do $= since that's a suffix match. This is fine, though, if you like it best

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Go with getElementById(). There wasn't an ID in 1.42, which you based your code on. I just did the minimal tweaks to your code to make it work with the latest rfcdiff, as the name attributes went away in 1.44.

old_chunk.style.outline = "1px solid red";
window.location.hash = "#" + new_str;
window.scrollBy(0,-100);
Expand Down