carbon-app / carbon

:black_heart: Create and share beautiful images of your source code

Home Page:https://carbon.now.sh

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Malformatted code

miguelvr opened this issue · comments

Describe the bug
Go code appears malformatted

To Reproduce
Steps to reproduce the behavior:

  1. Go to carbon.now.sh
  2. type the following code:
type Greeter interface {
  Greet(target string) string
}
  1. Copy image to clipboard, get the following:
    image

Expected behavior
Proper formatting

Info (please complete the following information):

commented

Hello,

Just adding a comment here.

Currently it is not only related to golang but every language. The image copied inside the clipboard is different than the one displayed in the website if the sentence is "too long"

Thanks !

I have the same problem.

class Person: NSObject, NSCoding {
    
    var name : String
    var sex : Int
        
    enum Key: String {
        case name
        case sex
    }
    
    init(name: String, sex: Int) {
        self.name = name
        self.sex = sex
    }
    
    func encode(with coder: NSCoder) {
        coder.encode(name, forKey: Key.name.rawValue)
        coder.encode(sex, forKey: Key.sex.rawValue)
    }
    
    required convenience init?(coder decoder: NSCoder) {
       let name = decoder.decodeObject(forKey: Key.name.rawValue)
        let sex = decoder.decodeInteger(forKey: Key.sex.rawValue)
        
        if let name = name as? String {
            self.init(name: name, sex: sex)
        }
        return nil
    }
    
}

carbon

Export with svg, everything works fine.