         }
     }
 
-    private func attributedString(from string: String) -> NSAttributedString {
-        let paragraphStyle = NSMutableParagraphStyle()
-        paragraphStyle.maximumLineHeight = 25
-        paragraphStyle.minimumLineHeight = 25
-
-        paragraphStyle.headIndent = 10
-        paragraphStyle.firstLineHeadIndent = 10
-        paragraphStyle.tailIndent = -10
-
-        let attributes = [
-            NSAttributedString.Key.paragraphStyle: paragraphStyle,
-            NSAttributedString.Key.font: Constants.TextView.font,
-            NSAttributedString.Key.foregroundColor: theme.colors.primaryText
-        ]
-
-        return NSAttributedString(string: string, attributes: attributes)
-    }
-
     private func enableProgressButton(_ enabled: Bool) {
         progressButton.isEnabled = enabled
     }

extension SectionEditorViewController: WKNavigationDelegate {
    func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
        loadWikitext()
    }
}

// MARK: - UITextViewDelegate

extension SectionEditorViewController: UITextViewDelegate {
    func textViewDidChange(_ textView: UITextView) {
        enableProgressButton(changesMade)
        scrollTextViewSoCursorNotUnderKeyboard(textView)
    }

    func textViewDidChangeSelection(_ textView: UITextView) {
        guard let selectedTextRange = textView.selectedTextRange else {
            preferredAccessoryView = defaultEditToolbar
            return
        }
        guard let selectedText = textView.text(in: selectedTextRange) else {
            preferredAccessoryView = defaultEditToolbar
            return
        }
        guard selectedText.wmf_hasNonWhitespaceText else {
            preferredAccessoryView = defaultEditToolbar
            return
        }
        preferredAccessoryView = contextualHighlightEditToolbar
    }
}

// MARK: - EditTextViewDataSource

extension SectionEditorViewController: EditTextViewInputViewControllerDelegate {

}

// MARK: - TextFormattingDelegate

extension SectionEditorViewController: TextFormattingDelegate {
    func textFormattingProvidingDidTapCloseButton(_ textFormattingProviding: TextFormattingProviding) {
        setCustomInputViewHidden(hidden: true)
    }
}

// MARK: - DefaultEditToolbarViewDelegate

extension SectionEditorViewController: DefaultEditToolbarViewDelegate {
    func defaultEditToolbarViewDidTapTextFormattingButton(_ defaultEditToolbarView: DefaultEditToolbarView, button: UIButton) {
        setCustomInputViewHidden(type: .textFormatting, hidden: false)
    }

    func defaultEditToolbarViewDidTapHeaderFormattingButton(_ defaultEditToolbarView: DefaultEditToolbarView, button: UIButton) {
        setCustomInputViewHidden(type: .textStyle, hidden: false)
    }

    func defaultEditToolbarViewDidTapAddCitationButton(_ defaultEditToolbarView: DefaultEditToolbarView, button: UIButton) {
        //
    }

    func defaultEditToolbarViewDidTapAddLinkButton(_ defaultEditToolbarView: DefaultEditToolbarView, button: UIButton) {
        //
    }

    func defaultEditToolbarViewDidTapUnorderedListButton(_ defaultEditToolbarView: DefaultEditToolbarView, button: UIButton) {
        //
    }

    func defaultEditToolbarViewDidTapOrderedListButton(_ defaultEditToolbarView: DefaultEditToolbarView, button: UIButton) {
        //
    }
}


    private var viewKeyboardRect = CGRect.null
    private var rightButton: UIBarButtonItem?

    private var theme = Theme.standard

    private lazy var closeButton: UIBarButtonItem = {
        let button = UIBarButtonItem.wmf_buttonType(.X, target: self, action: #selector(close(_:)))
