File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -231,7 +231,7 @@ impl Markdown {
231
231
match tag {
232
232
Tag :: Heading ( _, _, _)
233
233
| Tag :: Paragraph
234
- | Tag :: CodeBlock ( CodeBlockKind :: Fenced ( _ ) )
234
+ | Tag :: CodeBlock ( _ )
235
235
| Tag :: Item => {
236
236
push_line ( & mut spans, & mut lines) ;
237
237
}
@@ -242,15 +242,18 @@ impl Markdown {
242
242
match tag {
243
243
Tag :: Heading ( _, _, _)
244
244
| Tag :: Paragraph
245
- | Tag :: CodeBlock ( CodeBlockKind :: Fenced ( _ ) ) => {
245
+ | Tag :: CodeBlock ( _ ) => {
246
246
lines. push ( Spans :: default ( ) ) ;
247
247
}
248
248
_ => ( ) ,
249
249
}
250
250
}
251
251
Event :: Text ( text) => {
252
- // TODO: temp workaround
253
- if let Some ( Tag :: CodeBlock ( CodeBlockKind :: Fenced ( language) ) ) = tags. last ( ) {
252
+ if let Some ( Tag :: CodeBlock ( kind) ) = tags. last ( ) {
253
+ let language = match kind {
254
+ CodeBlockKind :: Fenced ( language) => language,
255
+ CodeBlockKind :: Indented => "" ,
256
+ } ;
254
257
let tui_text = highlighted_code_block (
255
258
text. to_string ( ) ,
256
259
language,
You can’t perform that action at this time.
0 commit comments