瀏覽代碼

style: fix image caption style to avoid mess up after export

Use span instead of div to wrap the image caption.
Le Tan 7 年之前
父節點
當前提交
6455e9ca19

+ 4 - 4
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);
     }
 };
 

+ 1 - 1
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;

+ 1 - 1
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;

+ 1 - 1
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;

+ 1 - 1
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;