Fix inline codeblocks

This commit is contained in:
Henry Hiles 2025-12-05 10:19:28 -05:00
commit 819512c737
No known key found for this signature in database

View file

@ -29,10 +29,13 @@ class Html extends ConsumerWidget {
final width = int.tryParse(element.attributes["width"] ?? "");
return switch (element.localName) {
"code" => CodeBlock(
element.text,
lang: element.className.replaceAll("language-", ""),
),
"code" =>
element.parent?.localName == "pre"
? CodeBlock(
element.text,
lang: element.className.replaceAll("language-", ""),
)
: null,
"blockquote" => Quoted(Html(element.innerHtml, client: client)),