-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds highlighting to individual CI detail section
The individual correction instruction, which can be accessed from the Market Place is now also highlighted. I decided to leave the background untouched, as the context, deletion and insertion blocks are already separated. It could be that for big CIs with big blocks it would be useful to color them, but this is a bit more dificult in this case because the block title is language dependent and must be read from a table header.
- Loading branch information
1 parent
0e40a0f
commit fde9ef2
Showing
2 changed files
with
40 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
function forEachCorrectionInstruction(callback) { | ||
$('pre').each(function(index) { | ||
var myElement = $( this ); | ||
|
||
callback(myElement); | ||
}); | ||
} | ||
|
||
$( document ).ready(function() { | ||
|
||
forEachCorrectionInstruction(function(myElement) { | ||
myElement.addClass('language-abap'); | ||
|
||
var newHtmlForElement = myElement.html(); | ||
|
||
newHtmlForElement = '<code>' + newHtmlForElement + '</code>'; | ||
|
||
/* Strip the script for generating new lines. If we don't do it, the following | ||
html replacement fails and the page becomes inconsistent. | ||
*/ | ||
newHtmlForElement = replaceAll(newHtmlForElement, '<script>document.write(\'\\r\\n\');</script>', ''); | ||
|
||
myElement.html(newHtmlForElement); | ||
}); | ||
|
||
Prism.highlightAll(); | ||
}); |