     }
     
     /// 格式化字符串
+    ///
+    /// Format a string
+    /// - parameter text:
+    ///     - 带有格式化命令的字符串
+    ///     - String with formatting commands
     public func format(_ text: String?) -> NSAttributedString {
         let _text: String
         let _result = NSMutableAttributedString(string: "")

        }
        
        // 文本分段
        var formatedLocation = 0
        var attrs: [(String, Any)] = []
        attrs.append((NSFontAttributeName, UIFont(name: fonts["normalfont"]!, size: normalFontSize) as Any))
        for result in regular.matches(in: _text, options: .reportProgress, range: NSMakeRange(0, _text.utf16.count)) {
            if formatedLocation < result.range.location {
                // 本段为内容
                let _t = (_text as NSString).substring(with: NSRange(location: formatedLocation, length: result.range.location - formatedLocation))
                var _attrDict: [String : Any] = [:]
                for (key, value) in attrs {

        let regular = try! NSRegularExpression(pattern: _controlSequancePattern, options: .useUnicodeWordBoundaries)
        
        // 添加附加格式设置
        // add prefix
        if text == nil || text == "" {
            return _result
        } else {
            let _appendx = ""
            // 目前不要求强制关闭标签
            // closer of command is NOT required
            //            for _ in regular.matches(in: KTTextFormater.defaultFormat + formatString, options: .reportProgress , range: NSMakeRange(0, (KTTextFormater.defaultFormat + formatString).characters.count)) {
            //                _appendx += _cs + _ce
            //            }
