From 1eda566da67cd829fafc614645871c1d7d446db6 Mon Sep 17 00:00:00 2001 From: Barbara Borges Ribeiro <barb.b.ribeiro@gmail.com> Date: Thu, 8 Mar 2018 21:38:51 +0000 Subject: [PATCH 1/2] on the JS side, grab the .html() provided by the `incorrect` (and the `correct`) arguments to `question()`. previously, we were grabbing the .text(), which stripped the html rich formatting. --- inst/htmlwidgets/quiz.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inst/htmlwidgets/quiz.js b/inst/htmlwidgets/quiz.js index e71660433..121c9be2a 100644 --- a/inst/htmlwidgets/quiz.js +++ b/inst/htmlwidgets/quiz.js @@ -57,7 +57,7 @@ HTMLWidgets.widget({ // look for custom messages var msg_class = correct ? '.correct' : '.incorrect'; - var message = $(el).find('.responses').children(msg_class).children('div').text(); + var message = $(el).find('.responses').children(msg_class).children('div').html(); var messages = $(el).find('.answers').children(msg_class + '[data-message]'); messages.each(function() { if ($(this).children('input').is(':checked')) { From 68fe59529c038ef33b8fb74bba2bcdbfac051d6f Mon Sep 17 00:00:00 2001 From: Barbara Borges Ribeiro <barb.b.ribeiro@gmail.com> Date: Fri, 9 Mar 2018 15:25:10 +0000 Subject: [PATCH 2/2] added NEWS item --- NEWS.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index 010be06f9..08467ac09 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,7 +1,9 @@ learnr 0.9.2 =========== -* Improved documentation for deploying `learnr` tutorials in Shiny Server. ([142](https://github.com/rstudio/learnr/issues/142)) +* Fixed [#136](https://github.com/rstudio/learnr/issues/136) by displaying full HTML messages (rather than just the text) if provided by the `incorrect` or the `correct` args to `question()`. ([#146](https://github.com/rstudio/learnr/pull/146)) + +* Improved documentation for deploying `learnr` tutorials in Shiny Server. ([#142](https://github.com/rstudio/learnr/issues/142)) * Fixed a highlight.js issue from rmarkdown 1.8. ([#133](https://github.com/rstudio/learnr/issues/133))