From 6455e9ca19c8c325e17a6f0002f87a1233c67bbb Mon Sep 17 00:00:00 2001 From: Le Tan Date: Thu, 1 Nov 2018 21:22:23 +0800 Subject: [PATCH] style: fix image caption style to avoid mess up after export Use span instead of div to wrap the image caption. --- src/resources/markdown_template.js | 8 ++++---- src/resources/themes/v_detorte/v_detorte.css | 2 +- src/resources/themes/v_moonlight/v_moonlight.css | 2 +- src/resources/themes/v_native/v_native.css | 2 +- src/resources/themes/v_pure/v_pure.css | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/resources/markdown_template.js b/src/resources/markdown_template.js index 60b8d4e4..3e4cb501 100644 --- a/src/resources/markdown_template.js +++ b/src/resources/markdown_template.js @@ -875,10 +875,10 @@ var insertImageCaption = function() { } // Add caption. - var captionDiv = document.createElement('div'); - captionDiv.classList.add(VImageCaptionClass); - captionDiv.textContent = img.alt; - img.insertAdjacentElement('afterend', captionDiv); + var captionSpan = document.createElement('span'); + captionSpan.classList.add(VImageCaptionClass); + captionSpan.textContent = img.alt; + img.insertAdjacentElement('afterend', captionSpan); } }; diff --git a/src/resources/themes/v_detorte/v_detorte.css b/src/resources/themes/v_detorte/v_detorte.css index 70bd8057..840b14e1 100644 --- a/src/resources/themes/v_detorte/v_detorte.css +++ b/src/resources/themes/v_detorte/v_detorte.css @@ -208,7 +208,7 @@ img.img-center { margin-right: auto; } -div.img-caption { +span.img-caption { min-width: 20%; max-width: 80%; display: inline-block; diff --git a/src/resources/themes/v_moonlight/v_moonlight.css b/src/resources/themes/v_moonlight/v_moonlight.css index 7ddb37c3..5e684c86 100644 --- a/src/resources/themes/v_moonlight/v_moonlight.css +++ b/src/resources/themes/v_moonlight/v_moonlight.css @@ -206,7 +206,7 @@ img.img-center { margin-right: auto; } -div.img-caption { +span.img-caption { min-width: 20%; max-width: 80%; display: inline-block; diff --git a/src/resources/themes/v_native/v_native.css b/src/resources/themes/v_native/v_native.css index 64bd3961..59fc814b 100644 --- a/src/resources/themes/v_native/v_native.css +++ b/src/resources/themes/v_native/v_native.css @@ -200,7 +200,7 @@ img.img-center { margin-right: auto; } -div.img-caption { +span.img-caption { min-width: 20%; max-width: 80%; display: inline-block; diff --git a/src/resources/themes/v_pure/v_pure.css b/src/resources/themes/v_pure/v_pure.css index c9e880a4..947e8c36 100644 --- a/src/resources/themes/v_pure/v_pure.css +++ b/src/resources/themes/v_pure/v_pure.css @@ -202,7 +202,7 @@ img.img-center { margin-right: auto; } -div.img-caption { +span.img-caption { min-width: 20%; max-width: 80%; display: inline-block;