forked from Henry-Hiles/nexus
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"] ?? "");
|
final width = int.tryParse(element.attributes["width"] ?? "");
|
||||||
|
|
||||||
return switch (element.localName) {
|
return switch (element.localName) {
|
||||||
"code" => CodeBlock(
|
"code" =>
|
||||||
element.text,
|
element.parent?.localName == "pre"
|
||||||
lang: element.className.replaceAll("language-", ""),
|
? CodeBlock(
|
||||||
),
|
element.text,
|
||||||
|
lang: element.className.replaceAll("language-", ""),
|
||||||
|
)
|
||||||
|
: null,
|
||||||
|
|
||||||
"blockquote" => Quoted(Html(element.innerHtml, client: client)),
|
"blockquote" => Quoted(Html(element.innerHtml, client: client)),
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue