File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
Components/Sources/Components/MarkdownPostView/Blocks/CodeBlockView Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -21,20 +21,20 @@ extension Markdown {
21
21
// MARK: - View
22
22
23
23
var body : some View {
24
- if case let . codeBlock( _, code) = unit. type {
25
- content ( code: code)
24
+ switch unit. type {
25
+ case let . codeBlock( codeType, code) :
26
+ content ( codeType: codeType, code: code)
27
+ default :
28
+ EmptyView ( )
26
29
}
27
30
}
28
31
29
32
// MARK: - View methods
30
33
31
- func content( code: String ) -> some View {
34
+ func content( codeType : String ? , code: String ) -> some View {
32
35
ScrollView ( . horizontal, showsIndicators: true ) {
33
36
VStack ( alignment: . center, spacing: . zero) {
34
- Text ( code)
35
- . font ( . custom( " Menlo-Regular " , size: 13 ) )
36
- . foregroundColor ( . foreground)
37
- . fixedSize ( horizontal: false , vertical: true )
37
+ CodeView ( codeType: codeType, code: code)
38
38
}
39
39
}
40
40
. padding ( [ . leading, . top, . trailing] , 12 )
You can’t perform that action at this time.
0 commit comments