Skip to content

Commit

Permalink
fix: Remove the blank line inserted between code blocks and captions
Browse files Browse the repository at this point in the history
This change is part of the fix for
#645. The good thing is
that there's no functional change in how Hugo/GoldMark (tested on Hugo
v0.99.1) render these Markdown files after the change.

So, to the user, it will be just a cosmetic change, that now there are
no blank lines between code blocks and their captions.
  • Loading branch information
kaushalmodi committed May 27, 2022
1 parent eac4b45 commit 71cb5f2
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 8 deletions.
2 changes: 1 addition & 1 deletion ox-hugo.el
Original file line number Diff line number Diff line change
Expand Up @@ -3436,7 +3436,7 @@ their Hugo site's config."
(caption-str
(org-html-convert-special-strings ;Interpret em-dash, en-dash, etc.
(org-export-data-with-backend caption 'html info))))
(format (concat "\n\n<div class=\"src-block-caption\">\n"
(format (concat "\n<div class=\"src-block-caption\">\n"
" <span class=\"src-block-number\">%s:</span>\n"
" %s\n"
"</div>")
Expand Down
1 change: 0 additions & 1 deletion test/site/content/posts/inlined-svg.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ style="stroke:#A80036;stroke-width:1.0;"/></g></svg>
class A
url of A is [[https://example.org/]]
```

<div class="src-block-caption">
<span class="src-block-number">Code Snippet 1:</span>
My class diagram
Expand Down
2 changes: 0 additions & 2 deletions test/site/content/posts/links-to-source-blocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ that the link jump is evident):
````emacs-lisp
(message "Hello")
````
<div class="src-block-caption">
<span class="src-block-number"><a href="#code-snippet--hello">Code Snippet 1</a>:</span>
Hello
Expand Down Expand Up @@ -116,7 +115,6 @@ blandit in.
````emacs-lisp
(message "Hello again")
````
<div class="src-block-caption">
<span class="src-block-number"><a href="#code-snippet--helloagain">Code Snippet 2</a>:</span>
Hello Again
Expand Down
2 changes: 0 additions & 2 deletions test/site/content/posts/source-block-caption.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ draft = false
```makefile
prefix = /dir/where/you/want/to/install/org # Default: /usr/share
```
<div class="src-block-caption">
<span class="src-block-number">Code Snippet 1:</span>
Prefix value in <code>local.mk</code>
Expand All @@ -16,7 +15,6 @@ prefix = /dir/where/you/want/to/install/org # Default: /usr/share
```emacs-lisp
(message "hello")
```

<div class="src-block-caption">
<span class="src-block-number">Code Snippet 2:</span>
Hello &#x2014; Caption with em-dash &#x2013; and &#x2013; en-dash
Expand Down
2 changes: 0 additions & 2 deletions test/site/content/singles/links-to-org-elements.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ that the link jump is evident):
````emacs-lisp
(message "Hello")
````
<div class="src-block-caption">
<span class="src-block-number"><a href="#code-snippet--hello">Programmlisting 1</a>:</span>
Hello
Expand Down Expand Up @@ -126,7 +125,6 @@ blandit in.
````emacs-lisp
(message "Hello again")
````
<div class="src-block-caption">
<span class="src-block-number"><a href="#code-snippet--helloagain">Programmlisting 2</a>:</span>
Hello Again
Expand Down

0 comments on commit 71cb5f2

Please sign in to comment.