Skip to content

Challenge fenced div with no inner fenced divs is converted to Discussion #672

@alex-ball

Description

@alex-ball

Challenge fenced divs display as intended when they contain another fenced div, such as a Hint or Solution:

::::::::::::::::::::::::::::::::: challenge

### CHALLENGE

I look like a CHALLENGE.

::::::::::::::::: solution

### SOLUTION

I look like a SOLUTION.

::::::::::::::::::::::::::

:::::::::::::::::::::::::::::::::::::::::::

But if they do not contain another fenced div, they are rendered as a Discussion:

::::::::::::::::: discussion

### DISCUSSION

I really am a DISCUSSION.

::::::::::::::::::::::::::::

:::::::::::::::::: challenge

### CHALLENGE

But I look like a DISCUSSION.

::::::::::::::::::::::::::::

As far as I can tell, this is because of the challenge_block function in lesson.lua, which contains the following lines:

if #this_challenge.content > 1 then
bookend = pandoc.Div(this_challenge.content, {class = "discussion"})
challenge_train:insert(callout_block(bookend))
end

Here, the challenge content is put in a div with the class "discussion". On the principle of least surprise, I would have thought the class should be "challenge".

Apologies if this is intended behaviour and I missed the documentation for it somewhere.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions