Selaa lähdekoodia

➕ Add support for markdown within notes & warnings (#64)

Sidharth R 3 vuotta sitten
vanhempi
commit
ae30c7d3b8

+ 4 - 4
exampleSite/content/post/cupper-shortcodes/index.md

@@ -21,24 +21,24 @@ Even a happy life cannot be without a measure of darkness, and the word happy wo
 
 ```
 {{</* note */>}}
-This is a note! It's something the reader may like to know about but is supplementary to the main content. Use notes when something may be interesting but not critical.
+This is a note! It's something the reader may like to know about but is supplementary to the main content. Use notes when something may be interesting but not critical. You can also *include* **markdown** stuffs like `code`. 
 {{</* /note */>}}
 ```
 
 {{< note >}}
-This is a note! It's something the reader may like to know about but is supplementary to the main content. Use notes when something may be interesting but not critical.
+This is a note! It's something the reader may like to know about but is supplementary to the main content. Use notes when something may be interesting but not critical. You can also *include* **markdown** stuffs like `code`.
 {{< /note >}}
 
 ## warning note
 
 ```
 {{</* warning */>}}
-This is a warning! It's about something the reader should be careful to do or to avoid doing. Use warnings when something could go wrong.
+This is a warning! It's about something the reader should be careful to do or to avoid doing. Use warnings when something could go wrong. You can also *include* **markdown** stuffs like `code`.
 {{</* /warning */>}}
 ```
 
 {{< warning >}}
-This is a warning! It's about something the reader should be careful to do or to avoid doing. Use warnings when something could go wrong.
+This is a warning! It's about something the reader should be careful to do or to avoid doing. Use warnings when something could go wrong. You can also *include* **markdown** stuffs like `code`.
 {{< /warning >}}
 
 ## cmd

+ 1 - 1
layouts/shortcodes/note.html

@@ -3,6 +3,6 @@
     <svg class="sign" aria-hidden="true" viewBox="0 0 41.667306 41.66729" focusable="false">
       <use xlink:href="#info"></use>
     </svg>
-    {{ .Inner }}
+    {{ .Inner | markdownify }}
   </div>
 </aside>

+ 1 - 1
layouts/shortcodes/warning.html

@@ -3,6 +3,6 @@
     <svg class="sign" aria-hidden="true" viewBox="0 0 48.430474 41.646302" focusable="false">
       <use xlink:href="#warning"></use>
     </svg>
-    {{ .Inner }}
+    {{ .Inner | markdownify }}
   </div>
 </aside>