Skip to content

Commit

Permalink
Replace text on new CodeView
Browse files Browse the repository at this point in the history
  • Loading branch information
Stampoo committed Mar 26, 2021
1 parent 3d0a385 commit ee6048f
Showing 1 changed file with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,19 @@ extension Markdown {

var body: some View {
switch unit.type {
case let .codeBlock(_, code):
content(code: code)
case let .codeBlock(codeType, code):
content(codeType: codeType, code: code)
default:
EmptyView()
}
}

// MARK: - View methods

func content(code: String) -> some View {
func content(codeType: String?, code: String) -> some View {
ScrollView(.horizontal, showsIndicators: true) {
VStack(alignment: .center, spacing: .zero) {
Text(code)
.font(.custom("Menlo-Regular", size: 13))
.foregroundColor(.foreground)
.fixedSize(horizontal: false, vertical: true)
CodeView(codeType: codeType, code: code)
}
}
.padding([.leading, .top, .trailing], 12)
Expand Down

0 comments on commit ee6048f

Please sign in to comment.