RunestoneInteractive / RunestoneComponents

Packaging of the Runestone tools for publishing educational materials using github pages
http://runestoneinteractive.org
Other
101 stars 225 forks source link

Micro Parsons: Render blocks raw when all blocks are html in non-html problems #1397

Open amy21206 opened 1 year ago

amy21206 commented 1 year ago

RunestoneInteractive/rs#20

Render blocks raw when micro Parsons find all blocks contain HTML, and when the language is not html.

Reason for asking all blocks to contain HTML: a complete HTML can be used as a string in other languages, e.g. in Python, re.match('<b>', '<b>content</b>')

Two examples are shown below (included in test).

image

image

micro-Parsons dependency is updated in this PR, so npm install is needed.

rbeezer commented 1 year ago

Yes, an author's source should specify "natural" language, or a computer language. (There might be a default for authors, perhaps for historical reasons.)

But in any event, the generated HTML for the problem should have an explicit attribute to that effect which the code here can react to unambiguously.