Returns quote character, used for value of given attribute. May return empty
string if attribute wasn’t quoted
@param  {TextEditor} editor
@param  {Object} attr
@return {String}
183365
function getAttributeQuote(editor, attr) {
	const range = new Range(attr.value ? attr.value.end : attr.end, attr.end);
	return range.isEmpty() ? '' : editor.getTextInBufferRange(range);
}
1131118
static function input_attr(&$attr)
	{
	    $str = " ";
        if(!empty($attr) && is_array($attr))
        {
            foreach($attr as $key=>$value)
            {
                $str .= "$key=\"$value\" ";
            }
        }
        return $str;
	}
856341
function getScriptAttribute(source, attribute) {
        var matches;
        var regex = RegExp(attribute + "=(\"([^\"]*)\")|('([^']*)')", "gi");
        if (matches = regex.exec(source)) {
            return matches[2];
        }
        return null;
    }
1116294
function parseAttributes(attrStr) {
    var reAttributes = /([^=<>\"\'\s]+)\s*(?:=\s*["']?([^"']*)["']?)?/g;
    var result = {};
    var match;

    if (attrStr) {
        while (match = reAttributes.exec(attrStr)) {
            result[match[1]] = match[2] || true;
        }
    }

    return result;
}
381767
function getAttributeValue(babelTypes, attributes, name) { // {{{
  var attribute = getAttribute(babelTypes, attributes, name);

  if (typeof attribute === 'undefined') {
    return attribute;
  }

  var attributeValue = attribute.value;

  if (typeof attributeValue.expression !== 'undefined') {
    return attributeValue.expression;
  }

  return attributeValue;
}
69031
function attribute(element, name, val) {
  return supports.attributes || !supports.html
  ? element.getAttribute(name)
  : (val = element.getAttributeNode(name)) && val.specified ? val.value : '';
}
478939
function quote(string) {
  var _Object$assign

  var quoteChar = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '"'

  if (quoteChar.length > 1 && process.env.NODE_ENV !== 'production') {
    console.error('quote: `quoteChar` is recommended as single character, but ' + JSON.stringify(quoteChar) + '.')
  }

  return _quote(
    string,
    quoteChar,
    getEscapable(quoteChar),
    Object.assign(
      {},
      commonMeta,
      ((_Object$assign = {}), (_Object$assign[quoteChar] = '\\' + quoteChar), _Object$assign)
    )
  )
}
213891
function(attr) {
      var startIndex, newAttr,
        i = 0,
        hasEndBracket = true;
      startIndex = attr.indexOf('[', i);
      if (startIndex < 0) {
        return attr;
      }
      newAttr = attr.substring(0, startIndex + 1);
      while (startIndex > 0 && hasEndBracket) {
         i = attr.indexOf(']', i) + 1;
         hasEndBracket = i > 0;
         startIndex = attr.indexOf('[', i);
         if (startIndex > 0) {
           newAttr = newAttr + attr.substring(i - 1, startIndex + 1);
         }
      }
      newAttr = newAttr + attr.substring(i - 1);
      return newAttr;
    }
1254
function getAttributeNameValue(node, at) {
	const name = at.name;
	let atnv;

	if (name.indexOf('href') !== -1 || name.indexOf('src') !== -1) {
		let friendly = axe.utils.getFriendlyUriEnd(node.getAttribute(name));
		if (friendly) {
			let value = encodeURI(friendly);
			if (value) {
				atnv = escapeSelector(at.name) + '$="' + escapeSelector(value) + '"';
			} else {
				return;
			}
		} else {
			atnv =
				escapeSelector(at.name) +
				'="' +
				escapeSelector(node.getAttribute(name)) +
				'"';
		}
	} else {
		atnv = escapeSelector(name) + '="' + escapeSelector(at.value) + '"';
	}
	return atnv;
}
369042
function stringQuoteChar(atom) {
  var str = toString(valueOf(atom));
  var quoteChar;
  if(isQuotedString(value)) {
    quoteChar = value.charAt(0);
  }
  return quoteChar;
}
829578
function getAttribute(buffer, i, l) {
  for (; i < l; i++) {
    let c = buffer[i];
    // space or /
    if (isSpaceCharacter(c) || c === 0x2F) {
      continue;
    }
    // ">"
    if (c === 0x3E) {
      i++;
      break;
    }
    let name = "";
    let value = "";
    nameLoop:for (; i < l; i++) {
      c = buffer[i];
      // "="
      if (c === 0x3D && name !== "") {
        i++;
        break;
      }
      // space
      if (isSpaceCharacter(c)) {
        for (i++; i < l; i++) {
          c = buffer[i];
          // space
          if (isSpaceCharacter(c)) {
            continue;
          }
          // not "="
          if (c !== 0x3D) {
            return { attr: { name, value }, i };
          }

          i++;
          break nameLoop;
        }
        break;
      }
      // / or >
      if (c === 0x2F || c === 0x3E) {
        return { attr: { name, value }, i };
      }
      // A-Z
      if (c >= 0x41 && c <= 0x5A) {
        name += String.fromCharCode(c + 0x20); // lowercase
      } else {
        name += String.fromCharCode(c);
      }
    }
    c = buffer[i];
    // space
    if (isSpaceCharacter(c)) {
      for (i++; i < l; i++) {
        c = buffer[i];
        // space
        if (isSpaceCharacter(c)) {
          continue;
        } else {
          break;
        }
      }
    }
    // " or '
    if (c === 0x22 || c === 0x27) {
      const quote = c;
      for (i++; i < l; i++) {
        c = buffer[i];

        if (c === quote) {
          i++;
          return { attr: { name, value }, i };
        }

        // A-Z
        if (c >= 0x41 && c <= 0x5A) {
          value += String.fromCharCode(c + 0x20); // lowercase
        } else {
          value += String.fromCharCode(c);
        }
      }
    }

    // >
    if (c === 0x3E) {
      return { attr: { name, value }, i };
    }

    // A-Z
    if (c >= 0x41 && c <= 0x5A) {
      value += String.fromCharCode(c + 0x20); // lowercase
    } else {
      value += String.fromCharCode(c);
    }

    for (i++; i < l; i++) {
      c = buffer[i];

      // space or >
      if (isSpaceCharacter(c) || c === 0x3E) {
        return { attr: { name, value }, i };
      }

      // A-Z
      if (c >= 0x41 && c <= 0x5A) {
        value += String.fromCharCode(c + 0x20); // lowercase
      } else {
        value += String.fromCharCode(c);
      }
    }
  }
  return { i };
}
1103656
def attr(value, options = {})
      unless value.is_a?(Symbol) || value.is_a?(String)
        raise ArgumentError.new("has_settings: symbol expected, but got a #{value.class}")
      end
      raise ArgumentError.new("has_settings: Option :default expected, but got #{options.keys.join(', ')}") unless options.blank? || (options.keys == [:default])

      default_value = options[:default]
      raise 'Error' unless value.to_s =~ REGEX_ATTR

      _set_value(value.to_s, default_value)
    end
127171
def quote_attrib(self, inStr):
        
        s1 = (isinstance(inStr, str) and inStr or
              '%s' % inStr)
        s1 = s1.replace('&', '&amp;')
        s1 = s1.replace('<', '&lt;')
        s1 = s1.replace('>', '&gt;')
        if '"' in s1:
        #    if "'" in s1:
            s1 = '%s' % s1.replace('"', "&quot;")
        #    else:
        #        s1 = "'%s'" % s1
        #else:
        #    s1 = '"%s"' % s1
        return s1
667664
def get_attr_text(self):
        """"""
        return ' '.join([
            '{}="{}"'.format(key, value)
            for key, value in self.attr.items()
        ])
429553
def format_value(self, attr, attr_props, value):
        
        if isinstance(value, bool):
            return str(value).upper()

        if any(i in ["enum"] for i in attr_props):
            if not isinstance(value, numbers.Number):
                return value.upper()  # value is from a set list, no need for quote
            else:
                return value

        if "type" in attr_props and attr_props["type"] == "string":  # and "enum" not in attr_props
            # check schemas for expressions and handle accordingly
            if self.is_expression(attr_props) and self.quoter.in_slashes(value):
                return value
            elif self.is_expression(attr_props) and (value.endswith("'i") or value.endswith('"i')):
                # for case insensitive regex
                return value
            else:
                return self.quoter.add_quotes(value)

        # expressions can be one of a string or an expression in brackets
        if any(i in ["oneOf", "anyOf"] for i in attr_props):  # and check that type string is in list
            if "oneOf" in attr_props:
                options_list = attr_props["oneOf"]
            else:
                options_list = attr_props["anyOf"]
            if self.quoter.is_string(value):
                if self.quoter.in_parenthesis(value):
                    pass
                elif attr == "expression" and self.quoter.in_braces(value):
                    # don't add quotes to list expressions such as {val1, val2}
                    pass
                elif attr != "text" and self.quoter.in_brackets(value):
                    # TEXT expressions are often "[field1]-[field2]" so need to leave quotes for these
                    pass
                elif value.startswith("NOT ") and self.quoter.in_parenthesis(value[4:]):
                    value = "NOT {}".format(value[4:])
                else:
                    value = self.check_options_list(options_list, value)

        if isinstance(value, list):
            new_values = []

            for v in value:
                if not isinstance(v, numbers.Number):
                    v = self.quoter.add_quotes(v)
                new_values.append(v)

            value = " ".join(list(map(str, new_values)))
        else:
            value = self.quoter.escape_quotes(value)

        return value
741152
function (attributes) {
            var val;

            for (var k in attributes) {
                // programtically created attribute
                if (!_.isString(attributes[k])) {
                    continue;
                }

                val = attributes[k];
                if (val.charAt(0) === '[' || val.charAt(0) === '{') {
                    try {
                        attributes[k] = JSON.parse(val);
                    } catch (e) {
                        LAZO.logger.warn('[lazoWidget] Error while parsing attribute value', e);
                    }
                } else if (_.isNumber(parseFloat(val)) && !_.isNaN(parseFloat(val))) {
                    attributes[k] = parseFloat(val);
                } else if (val === 'true') {
                    attributes[k] = true;
                } else if (val === 'false') {
                    attributes[k] = false;
                }
            }

            return attributes;
        }
1290331
function(attr) {
      var html;
      if (html = this._escapedAttributes[attr]) return html;
      var val = this.attributes[attr];
      return this._escapedAttributes[attr] = escapeHTML(val == null ? '' : '' + val);
    }