fix: handle playground mode as HTML mode in preview rendering
Playground mode was falling through to the CSS branch, wrapping user code in a <style> tag. This prevented HTML elements and font styles from rendering correctly. Now playground mode is treated like HTML mode, allowing templates with <style> blocks and HTML content to work properly. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
This commit is contained in:
@@ -206,8 +206,8 @@ export class LessonEngine {
|
||||
const iframeDoc = iframe.contentDocument || iframe.contentWindow.document;
|
||||
iframeDoc.open();
|
||||
|
||||
if (mode === "html") {
|
||||
// For HTML mode, user code IS the HTML content
|
||||
if (mode === "html" || mode === "playground") {
|
||||
// For HTML/playground mode, user code IS the HTML content (may include <style> blocks)
|
||||
const userHtml = this.userCode || "";
|
||||
iframeDoc.write(`
|
||||
<!DOCTYPE html>
|
||||
@@ -301,8 +301,8 @@ export class LessonEngine {
|
||||
const iframeDoc = iframe.contentDocument || iframe.contentWindow.document;
|
||||
iframeDoc.open();
|
||||
|
||||
if (mode === "html") {
|
||||
// For HTML mode, solution code IS the HTML content
|
||||
if (mode === "html" || mode === "playground") {
|
||||
// For HTML/playground mode, solution code IS the HTML content
|
||||
iframeDoc.write(`
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
Reference in New Issue
Block a user