rvanhorn / hugo-dynamic-tabs

A Hugo theme component that allows you to add dynamic tabs in your markdown files.
https://hugo-dynamic-tabs.netlify.app/
MIT License
56 stars 14 forks source link

Code formatting not displaying correctly #1

Closed arnonzooz closed 5 years ago

arnonzooz commented 5 years ago

Hello,

First, thanks for this component. Really like it!

I implemented the component and would like to show formatted code examples in each tab. For some reason, it works for me only on the first tab. On tab 2 and 3 the code is rendered as plain text without any code formatting being applied. Can you let me know if I'm missing something? Here's my code:

{< tabs tabTotal="3" tabID="1" tabName1="Javascript" tabName2="Tab 2" tabName3="Tab 3" >}}
{{< tab tabNum="1" >}}

```javascript
var test = "ok"

{{< /tab >}}

{{< tab tabNum="2" >}}

var test = "not formatted"

{{< /tab >}}

{{< tab tabNum="3" >}}

var test = "not formatted"

{{< /tab >}} {{< /tabs >}}

arnonzooz commented 5 years ago

Hello,

Managed to solve this by changing the shortcode delimiter from < > to %.

Arnon

rvanhorn commented 5 years ago

Sorry for the late reply, didn't see the GitHub email.

Originally I had the delimiter as % but kept running into the same issue as you so changed it to < >, I wonder if something changed in Hugo. I'll have to check this out later on when I have some free time.

nistara commented 5 years ago

Thanks for this great component! I had the same issue about code not displaying correctly, and got it to work by adding another markdownify option in tab.html . Created a pull request for you to review: https://github.com/rvanhorn/hugo-dynamic-tabs/pull/2