Fix AsciiDoc code block styling (#1168)

These changes accommodate for some difference in the HTML structure AsciiDoc produces for source code listings:

 * proper padding for source code listings
 * proper vertical margin after source code listings
 * proper placement of the copy button if enabled

Closes #1163
This commit is contained in:
flyx
2023-02-19 02:27:44 +01:00
committed by GitHub
parent f8e93980b4
commit fdf48d2fd3
2 changed files with 25 additions and 6 deletions

View File

@@ -488,7 +488,7 @@ jtd.onReady(function(){
jtd.onReady(function(){
var codeBlocks = document.querySelectorAll('div.highlighter-rouge, div.listingblock, figure.highlight');
var codeBlocks = document.querySelectorAll('div.highlighter-rouge, div.listingblock > div.content, figure.highlight');
// note: the SVG svg-copied and svg-copy is only loaded as a Jekyll include if site.enable_copy_code_button is true; see _includes/icons/icons.html
var svgCopied = '<svg viewBox="0 0 24 24" class="copy-icon"><use xlink:href="#svg-copied"></use></svg>';