Replace the placeholder if it is one or continue.
976558
def visit(self, node):
        
        if isinstance(node, Placeholder):
            return self.placeholders[node.id]
        else:
            return super(PlaceholderReplace, self).visit(node)
1201407
public function replacePlaceholders($string, $values, $quoteIfNecessary = true)
    {
        foreach ($values as $placeholder => $value) {
            $replacement = $quoteIfNecessary ? $this->quoteIfNecessary($value) : $value;
            $string = str_replace(":{$placeholder}", $replacement, $string);
        }

        return $string;
    }
694829
function replace(src, token, value) {
    var idx = src.indexOf(token);
    if (idx == -1) {
        return;
    }
    return src.substr(0, idx) + value + src.substr(idx + token.length);
}
1160951
def fill_placeholders(self, tags):
        """"""
        def change_p_node_tags(node, children):
            if isinstance(node, Placeholder):
                value = ConstExpr(tags[node.name])
                return value
            else:
                return node.clone(children)

        return map_tree(change_p_node_tags, self)
1332816
def parse_placeholder(parser, token):
    """"""
    params = {}

    bits = token.split_contents()
    count = len(bits)
    error_string = '%r tag requires at least one argument' % bits[0]
    if count <= 1:
        raise TemplateSyntaxError(error_string)
    try:
        name = unescape_string_literal(bits[1])
    except ValueError:
        name = bits[1]
    remaining = bits[2:]
    simple_options = ['parsed', 'inherited', 'untranslated', 'shared', 'block']
    param_options = ['as', 'on', 'with', 'section']
    all_options = simple_options + param_options
    while remaining:
        bit = remaining[0]
        if bit not in all_options:
            raise TemplateSyntaxError(
                "%r is not an correct option for a placeholder" % bit)
        if bit in param_options:
            if len(remaining) < 2:
                raise TemplateSyntaxError(
                    "Placeholder option '%s' need a parameter" % bit)
            if bit == 'as':
                params['as_varname'] = remaining[1]
            if bit == 'with':
                params['widget'] = remaining[1]
            if bit == 'on':
                params['page'] = remaining[1]
            if bit == 'section':
                params['section'] = unescape_string_literal(remaining[1])
            remaining = remaining[2:]
        elif bit == 'parsed':
            params['parsed'] = True
            remaining = remaining[1:]
        elif bit == 'inherited':
            params['inherited'] = True
            remaining = remaining[1:]
        elif bit == 'untranslated':
            params['untranslated'] = True
            remaining = remaining[1:]
        elif bit == 'shared':
            params['shared'] = True
            remaining = remaining[1:]
        elif bit == 'block':
            remaining = remaining[1:]
            nodelist = parser.parse(('endplaceholder',))
            parser.delete_first_token()
            params['nodelist'] = nodelist

    return name, params
62823
function replace (obj, key, val) {
  if (obj.hasOwnProperty(key)) obj[key] = val;
  return obj;
}
574811
function (name, value, oldValue) {
                this.$InputElement.onbind.apply(this, arguments);
                if (name === "value") {
                    value = (value != null) ? value + "" : "";
                    if (value) {
                        this._removePlaceholder();
                    }
                    this._domElt.value = value;
                    this._setPlaceholder();
                }
            }
164257
def kreplace(self, key, value):
        
        for item in self:
            if key in item:
                item[key] = value
1192656
def _replace_placeholder(self, spider):
        
        return self.db_name % {'spider': spider.name}, self.collection_name % {'spider': spider.name}
263396
def fill_placeholders (out)
      re = Regexp.new('%' + @replacement_hash + '%(\d+)%')
      out.gsub re do |m|
        m.gsub!(re, "\\1")
        @placeholders[m.to_i]
      end
    end
569400
def OnReplaceAll(self, event):
        """"""

        find_string = event.GetFindString()
        flags = self._wxflag2flag(event.GetFlags())
        replace_string = event.GetReplaceString()

        findpositions = self.grid.actions.find_all(find_string, flags)

        with undo.group(_("Replace all")):
            self.grid.actions.replace_all(findpositions, find_string,
                                          replace_string)

        event.Skip()
762925
function () {
                if (this._hasPlaceholder) {
                    var element = this._domElt;
                    var cssClass = new aria.utils.ClassList(element);
                    element.value = "";
                    this._hasPlaceholder = false;
                    cssClass.remove('placeholder');
                    cssClass.$dispose();
                    this._domElt.unselectable = "off";
                }
            }
632776
function () {
            var selected;
            if (this.isPlaceholderOptionSelected()) {
                this.updateSelection(null);
                this.close();
                this.setPlaceholder();
            } else {
                var self = this;
                this.opts.initSelection.call(null, this.opts.element, function(selected){
                    if (selected !== undefined && selected !== null) {
                        self.updateSelection(selected);
                        self.close();
                        self.setPlaceholder();
                        self.nextSearchTerm = self.opts.nextSearchTerm(selected, self.search.val());
                    }
                });
            }
        }
1141456
function insertContentIntoPlaceholder(node, content) {
	const state = {replaced: false};

	node.value = replacePlaceholder(node.value, content, state);
	node.attributes.forEach(attr => {
		if (attr.value) {
			node.setAttribute(attr.name, replacePlaceholder(attr.value, content, state));
		}
	});

	return state.replaced;
}
151946
def do_fileplaceholder(parser, token):
    
    name, params = parse_placeholder(parser, token)
    return FilePlaceholderNode(name, **params)
120340
function setPlaceholder() {
                if (o.placeholder && !tagList.length && !$('.deleted, .placeholder, input', ed).length) {
                    ed.append('<li class="placeholder"><div>' + o.placeholder + '</div></li>');
                }
            }
705872
def update_placeholders(self, format_string, placeholders):
        
        # Tokenize the format string and process them
        output = []
        for token in self.tokens(format_string):
            if token.group("key") in placeholders:
                output.append(
                    "{%s%s}" % (placeholders[token.group("key")], token.group("format"))
                )
                continue
            elif token.group("command"):
                # update any placeholders used in commands
                commands = parse_qsl(token.group("command"), keep_blank_values=True)
                # placeholders only used in `if`
                if "if" in [x[0] for x in commands]:
                    items = []
                    for key, value in commands:
                        if key == "if":
                            # we have to rebuild from the parts we have
                            condition = Condition(value)
                            variable = condition.variable
                            if variable in placeholders:
                                variable = placeholders[variable]
                                # negation via `!`
                                not_ = "!" if not condition.default else ""
                                condition_ = condition.condition or ""
                                # if there is no condition then there is no
                                # value
                                if condition_:
                                    value_ = condition.value
                                else:
                                    value_ = ""
                                value = "{}{}{}{}".format(
                                    not_, variable, condition_, value_
                                )
                        if value:
                            items.append("{}={}".format(key, value))
                        else:
                            items.append(key)

                    # we cannot use urlencode because it will escape things
                    # like `!`
                    output.append(r"\?{} ".format("&".join(items)))
                    continue
            value = token.group(0)
            output.append(value)
        return u"".join(output)