RunestoneComponents icon indicating copy to clipboard operation
RunestoneComponents copied to clipboard

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

Open amy21206 opened this issue 1 year ago • 1 comments

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.

amy21206 avatar May 10 '23 10:05 amy21206

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.

rbeezer avatar May 16 '23 19:05 rbeezer