Skip to content

Implementing hidden message under a dropdown which opens when clicked #1462

Answered by mattxwang
vikas-bandaru asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @vikas-bandaru, thanks for submitting a discussion! Long story short, kramdown (the markdown compiler/converter used by Jekyll) does not process markdown within HTML by default. If you want kramdown to parse the inside of an HTML block(s) as markdown, you need to use the markdown attribute. In your case, you likely want something like this:

<details markdown="block">
  <summary>Solution</summary>
  ```java
  public String greetWithName(String name)
  {
      return "Hello, " + name ;
  }
  ```
</details>

You can read more about this in the kramdown documentation, though it may not be the most beginner friendly. Let me know if you've got other questions!

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@vikas-bandaru
Comment options

Answer selected by vikas-bandaru
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants