Fix inline codeblocks
This commit is contained in:
parent
e06a17aa82
commit
819512c737
1 changed files with 7 additions and 4 deletions
|
|
@ -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)),
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue