Markdown and HTML formatting not rendering within option labels #224
-
DescriptionI've been able to use markdown and html formatting successfully within question labels, however using such formatting within my option labels has been unsuccessful and doesn't correctly render. There are no error or warning messages that I've seen, just literal carryover of the formatting characters. From the documentation, I know it should be possible. I've checked this both in local preview and after hosting as a shiny app. Here's an example question where formatting works within the label, but not the options.
I did try to use just markdown or just html formatting rather than mixing them. I also tried removing the formatting within the label to see if maybe the formatting of both the label and options at the same time was the issue, but it didn't fix it. Is this a bug, or am I not using the formatting correctly? Thanks! My surveydown version is |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 6 replies
-
|
I can replicate the error. I found that the markdown formatting works with This demo survey shows the difference: ---
format: html
echo: false
warning: false
use-cookies: false
---
```{r}
library(surveydown)
```
::: {.sd-page id=page1}
```{r}
sd_question(
type = "mc",
id = "like_apple",
label = "Do you like **apples**?",
option = c(
"**Yes**" = "yes",
"_No_" = "no"
)
)
sd_question(
type = "mc_buttons",
id = "like_apple_buttons",
label = "Do you like **apples**?",
option = c(
"**Yes**" = "yes",
"_No_" = "no"
)
)
```
:::Which renders into this:
@pingfan-hu any ideas? |
Beta Was this translation helpful? Give feedback.
-
|
Hi @kweav , the problem is now fixed. You can take a look at our updated demo survey of question types. On the first page, you can choose "Take me to the page on Question Formatting" (aka the 2nd option) to go directly to that page. In this page, you'll see all multiple choice question types now support markdown in both label and option. The latest update is in our pak::pak("surveydown-dev/surveydown@v0.13.4-gssencmode-fix", ask = FALSE)I will have the branch checked and confirmed by @jhelvy , and we'll later on merge to Any more problems let me know! |
Beta Was this translation helpful? Give feedback.
-
|
Now since the problem has been solved, I'll close the discussion. @kweav if you have any further questions, feel free to open a new discussion. |
Beta Was this translation helpful? Give feedback.



Hi @kweav , the problem is now fixed. You can take a look at our updated demo survey of question types. On the first page, you can choose "Take me to the page on Question Formatting" (aka the 2nd option) to go directly to that page. In this page, you'll see all multiple choice question types now support markdown in both label and option.
The latest update is in our
v0.13.4branch. To install, use the scripts below:I will have the branch checked and confirmed by @jhelvy , and we'll later on merge to
main.Any more problems let me know!