 
 
     @IBAction func switchEditionMode() {
-        editor.toggleHTML()
+        let html = editor.toHTML()
+        NSLog("HTML \(html)")
     }
 
 

    }

    func toggleBold() {
        editor.toggleBold(range: textView.selectedRange)
    }


    func toggleItalic() {
        editor.toggleItalic(range: textView.selectedRange)
    }


    func toggleUnderline() {
        editor.toggleUnderline(range: textView.selectedRange)
    }


    func toggleStrikethrough() {
        editor.toggleStrikethrough(range: textView.selectedRange)
    }


    func toggleOrderedList() {
        editor.toggleOrderedList(range: textView.selectedRange)
    }


    func toggleUnorderedList() {
        editor.toggleUnorderedList(range: textView.selectedRange)
    }


    func toggleBlockquote() {
        editor.toggleBlockquote(range: textView.selectedRange)
    }


    func toggleLink() {
        editor.toggleLink(range: textView.selectedRange, params: [String : AnyObject]())
    }


    func insertImage() {
        editor.insertImage(textView.selectedRange.location, params: [String : AnyObject]())
    }

    // MARK: -


class EditorDemoController: UIViewController
{
    private var bottomConstraint: NSLayoutConstraint!


    private (set) lazy var editor: AztecVisualEditor = {
        let e = AztecVisualEditor(textView: self.richTextView)
        return e
    }()


    private(set) lazy var richTextView: UITextView = {
        let tv = AztecVisualEditor.createTextView()
        let font = UIFont.preferredFontForTextStyle(UIFontTextStyleBody)

