From 0a9c4e1afb0620fc21c7908a7d2a2e40934f95a4 Mon Sep 17 00:00:00 2001 From: jverzani Date: Tue, 31 Oct 2023 13:39:50 -0400 Subject: [PATCH] process units strings --- docs/src/quarto-example.qmd | 3 +-- src/show_methods.jl | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/src/quarto-example.qmd b/docs/src/quarto-example.qmd index 871b793..714730a 100644 --- a/docs/src/quarto-example.qmd +++ b/docs/src/quarto-example.qmd @@ -10,7 +10,6 @@ jupyter: julia-1.9 ```{julia} #| echo: false using QuizQuestions -using LaTeXStrings using Plots ``` @@ -19,7 +18,7 @@ $$ ```{julia} #| echo: false -buttonq([L"1 + 1", L"2+2", L"-1 + -1"], 1; +buttonq(["1 + 1", L"2+2", L"-1 + -1"], 1; label = L"Which adds to $2$?", explanation="Add 'em up") ``` diff --git a/src/show_methods.jl b/src/show_methods.jl index 529e1bf..a4068e0 100644 --- a/src/show_methods.jl +++ b/src/show_methods.jl @@ -52,7 +52,7 @@ function prepare_question(x::Numericq, ID) FORM = Mustache.render(html_templates["inputq_form"]; ID=ID, PLACEHOLDER = isnothing(x.placeholder) ? "Numeric answer" : x.placeholder, - UNITS=x.units, + UNITS=_markdown_to_html(x.units), TYPE="number", HINT = length(x.label) == 0 ? x.hint : "" )