Creates a snippet that generates a constant text string.
192954
public static SourceSnippet forText(final String text) {
    return new SourceSnippet() {
      public String getSource(InjectorWriteContext writeContext) {
        return text;
      }
    };
  }
207427
def to_s
      text = ''

      text << tag_output_string + "\n" unless tags.empty?
      text << "Feature:#{name_output_string}"
      text << "\n" + description_output_string unless description_text.empty?
      text << "\n\n" + background_output_string if background
      text << "\n\n" + tests_output_string unless tests.empty?

      text
    end
1133665
function (name, preset) {
    if(typeof name !== 'string') {
      throw new TypeError('snippets#get expects `name` to be a string.');
    }
    if (utils.startsWith(name, './')) {
      return this.read(name);
    }

    // ex: `http(s)://api.github.com/...`
    if (/^\w+:\/\//.test(name) || preset) {
      var snippet = this.downloader
        .fetch(name, preset)
        .download();

      var parsed = url.parse(name);
      this.set(parsed.pathname, snippet);
      return new Snippet(snippet);
    }

    var res = this.snippets[name]
      || this.store.get(name)
      || utils.get(this.snippets, name);
    return new Snippet(res);
  }
95976
function makePossibleRangesHTML(source, tokens, offset) {
		offset = offset || 0;
		var result = [];
		var attrStart = -1, attrName = '', attrValue = '', attrValueRange, tagName;
		tokens.forEach(function(tok) {
			switch (tok.type) {
				case 'tag':
					tagName = source.substring(tok.start, tok.end);
					if (/^<[\w\:\-]/.test(tagName)) {
						// add tag name
						result.push(range({
							start: tok.start + 1, 
							end: tok.end
						}));
					}
					break;
				case 'attribute':
					attrStart = tok.start;
					attrName = source.substring(tok.start, tok.end);
					break;
					
				case 'string':
					// attribute value
					// push full attribute first
					result.push(range(attrStart, tok.end - attrStart));
					
					attrValueRange = range(tok);
					attrValue = attrValueRange.substring(source);
					
					// is this a quoted attribute?
					if (isQuote(attrValue.charAt(0)))
						attrValueRange.start++;
					
					if (isQuote(attrValue.charAt(attrValue.length - 1)))
						attrValueRange.end--;
					
					result.push(attrValueRange);
					
					if (attrName == 'class') {
						result = result.concat(classNameRanges(attrValueRange.substring(source), attrValueRange.start));
					}
					
					break;
			}
		});
		
		// offset ranges
		result = result.filter(function(item) {
			if (item.length()) {
				item.shift(offset);
				return true;
			}
		});

		// remove duplicates
		return utils.unique(result, function(item) {
			return item.toString();
		});
	}
540160
public synchronized String getText() {
        StringBuilder bob = new StringBuilder(lines.get(0));
        for(int i = 1; i < lines.size(); i++) {
            bob.append("\n").append(lines.get(i));
        }
        return bob.toString();
    }
1227571
function _convertPlainTextToDocument (tx, args) {
  let lines = args.text.split(/\s*\n\s*\n/)
  let pasteDoc = tx.getDocument().newInstance()
  let defaultTextType = pasteDoc.getSchema().getDefaultTextType()
  let container = pasteDoc.create({
    type: '@container',
    id: SNIPPET_ID,
    nodes: []
  })
  let node
  if (lines.length === 1) {
    node = pasteDoc.create({
      id: TEXT_SNIPPET_ID,
      type: defaultTextType,
      content: lines[0]
    })
    container.append(node.id)
  } else {
    for (let i = 0; i < lines.length; i++) {
      node = pasteDoc.create({
        id: uuid(defaultTextType),
        type: defaultTextType,
        content: lines[i]
      })
      container.append(node.id)
    }
  }
  return pasteDoc
}
1251331
private boolean appendText(final String indent, final Element element, final StringBuilder sb) {
        if (sb != null) {
            if (element.getTagName().indexOf(":annotation") < 0 && element.getTagName().indexOf(":documentation") < 0) {
                sb.append(String.format(ELEMENT_LOG, indent, element.getTagName(), element.getAttribute("name")));
                return true;
            }
        }
        return false;
    }
159553
def CreateString(self, s, encoding='utf-8', errors='strict'):
        """"""

        self.assertNotNested()
        ## @cond FLATBUFFERS_INTERNAL
        self.nested = True
        ## @endcond

        if isinstance(s, compat.string_types):
            x = s.encode(encoding, errors)
        elif isinstance(s, compat.binary_types):
            x = s
        else:
            raise TypeError("non-string passed to CreateString")

        self.Prep(N.UOffsetTFlags.bytewidth, (len(x)+1)*N.Uint8Flags.bytewidth)
        self.Place(0, N.Uint8Flags)

        l = UOffsetTFlags.py_type(len(s))
        ## @cond FLATBUFFERS_INTERNAL
        self.head = UOffsetTFlags.py_type(self.Head() - l)
        ## @endcond
        self.Bytes[self.Head():self.Head()+l] = x

        return self.EndVector(len(x))
988159
def latexsnippet(code, kvs, staffsize=17, initiallines=1):
    """"""
    snippet = ''
    staffsize = int(kvs['staffsize']) if 'staffsize' in kvs \
        else staffsize
    initiallines = int(kvs['initiallines']) if 'initiallines' in kvs \
        else initiallines
    annotationsize = .5 * staffsize
    if 'mode' in kvs:
        snippet = (
            "\\greannotation{{\\fontsize{%s}{%s}\\selectfont{}%s}}\n" %
            (annotationsize, annotationsize, kvs['mode'])
        ) + snippet
    if 'annotation' in kvs:
        snippet = (
            "\\grechangedim{annotationseparation}{%s mm}{fixed}\n"
            "\\greannotation{{\\fontsize{%s}{%s}\\selectfont{}%s}}\n" %
            (staffsize / 60, annotationsize, annotationsize, kvs['annotation'])
        ) + snippet
    snippet = (
        "\\gresetinitiallines{%s}\n" % initiallines +
        "\\grechangestaffsize{%s}\n" % staffsize +
        "\\grechangestyle{initial}{\\fontsize{%s}{%s}\\selectfont{}}" %
        (2.5 * staffsize, 2.5 * staffsize)
    ) + snippet
    snippet = "\\setlength{\\parskip}{0pt}\n" + snippet + code
    return snippet
904627
static String stringLiteralWithDoubleQuotes(String value, String indent) {
    StringBuilder result = new StringBuilder(value.length() + 2);
    result.append('"');
    for (int i = 0; i < value.length(); i++) {
      char c = value.charAt(i);
      // trivial case: single quote must not be escaped
      if (c == '\'') {
        result.append("'");
        continue;
      }
      // trivial case: double quotes must be escaped
      if (c == '\"') {
        result.append("\\\"");
        continue;
      }
      // default case: just let character literal do its work
      result.append(characterLiteralWithoutSingleQuotes(c));
      // need to append indent after linefeed?
      if (c == '\n' && i + 1 < value.length()) {
        result.append("\"\n").append(indent).append(indent).append("+ \"");
      }
    }
    result.append('"');
    return result.toString();
  }
931921
@SuppressWarnings("checkstyle:all")
	protected void generateAbstractAppender() {
		final TypeReference abstractAppender = getCodeElementExtractor().getAbstractAppenderImpl();
		StringConcatenationClient content = new StringConcatenationClient() {
			@Override
			protected void appendTo(TargetStringConcatenation it) {
				it.append("/** Abstract implementation of an appender for the " //$NON-NLS-1$
						+ getLanguageName() + " language."); //$NON-NLS-1$
				it.newLine();
				it.append(" */"); //$NON-NLS-1$
				it.newLine();
				it.append("@SuppressWarnings(\"all\")"); //$NON-NLS-1$
				it.newLine();
				it.append("public abstract class "); //$NON-NLS-1$
				it.append(abstractAppender.getSimpleName());
				it.append(" {"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\tpublic static final String OVERRIDEN_TYPE_SCOPE_PROVIDER_NAME = \""); //$NON-NLS-1$
				it.append(SCOPE_PROVIDER_NAME);
				it.append("\";"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\t@"); //$NON-NLS-1$
				it.append(Inject.class);
				it.newLine();
				it.append("\tprivate "); //$NON-NLS-1$
				it.append(Injector.class);
				it.append(" originalInjector;"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\t@"); //$NON-NLS-1$
				it.append(Inject.class);
				it.newLine();
				it.append("\t@"); //$NON-NLS-1$
				it.append(Named.class);
				it.append("(OVERRIDEN_TYPE_SCOPE_PROVIDER_NAME)"); //$NON-NLS-1$
				it.newLine();
				it.append("\tprivate "); //$NON-NLS-1$
				it.append(AbstractTypeScopeProvider.class);
				it.append(" scopeProvider;"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\t@"); //$NON-NLS-1$
				it.append(Inject.class);
				it.newLine();
				it.append("\tprivate "); //$NON-NLS-1$
				it.append(TypeScopes.class);
				it.append(" typeScopes;"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\tprivate boolean isFormatting;"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\t/** Set if this building is formatting the generated code."); //$NON-NLS-1$
				it.newLine();
				it.append("\t *"); //$NON-NLS-1$
				it.newLine();
				it.append("\t * @param formatting <code>true</code> if the appender is formatting the generated code."); //$NON-NLS-1$
				it.newLine();
				it.append("\t */"); //$NON-NLS-1$
				it.newLine();
				it.append("\tpublic void setFormatting(boolean formatting) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tthis.isFormatting = formatting;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\t/** Replies if this building is formatting the generated code."); //$NON-NLS-1$
				it.newLine();
				it.append("\t *"); //$NON-NLS-1$
				it.newLine();
				it.append("\t * @return <code>true</code> if the appender is formatting the generated code."); //$NON-NLS-1$
				it.newLine();
				it.append("\t */"); //$NON-NLS-1$
				it.newLine();
				it.append("\tpublic boolean isFormatting() {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\treturn this.isFormatting;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\t/** Replies the context for type resolution."); //$NON-NLS-1$
				it.newLine();
				it.append("\t * @return the context, or <code>null</code> if the Ecore object is the context."); //$NON-NLS-1$
				it.newLine();
				it.append("\t */"); //$NON-NLS-1$
				it.newLine();
				it.append("\tprotected abstract "); //$NON-NLS-1$
				it.append(IJvmTypeProvider.class);
				it.append(" getTypeResolutionContext();"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\t/** Build the source code and put it into the given appender."); //$NON-NLS-1$
				it.newLine();
				it.append("\t * @param appender the object that permits to create the source code."); //$NON-NLS-1$
				it.newLine();
				it.append("\t */"); //$NON-NLS-1$
				it.newLine();
				it.append("\tpublic abstract void build("); //$NON-NLS-1$
				it.append(ISourceAppender.class);
				it.append(" appender) throws "); //$NON-NLS-1$
				it.append(IOException.class);
				it.append(";"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\t/** Build the source code and put it into the given appender."); //$NON-NLS-1$
				it.newLine();
				it.append("\t * @param the object to serialize"); //$NON-NLS-1$
				it.newLine();
				it.append("\t * @param appender the object that permits to create the source code."); //$NON-NLS-1$
				it.newLine();
				it.append("\t * @param context the context for type resolution."); //$NON-NLS-1$
				it.newLine();
				it.append("\t */"); //$NON-NLS-1$
				it.newLine();
				it.append("\tprotected void build("); //$NON-NLS-1$
				it.append(EObject.class);
				it.append(" object, "); //$NON-NLS-1$
				it.append(ISourceAppender.class);
				it.append(" appender) throws "); //$NON-NLS-1$
				it.append(IOException.class);
				it.append(" {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tfinal "); //$NON-NLS-1$
				it.append(IJvmTypeProvider.class);
				it.append(" provider = getTypeResolutionContext();"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tif (provider != null) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tfinal "); //$NON-NLS-1$
				it.append(Map.class);
				it.append("<"); //$NON-NLS-1$
				it.append(Key.class);
				it.append("<?>, "); //$NON-NLS-1$
				it.append(Binding.class);
				it.append("<?>> bindings = this.originalInjector.getBindings();"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t"); //$NON-NLS-1$
				it.append(Injector.class);
				it.append(" localInjector = "); //$NON-NLS-1$
				it.append(getBuilderFactoryImpl());
				it.append(".createOverridingInjector(this.originalInjector, "); //$NON-NLS-1$
				it.append("(binder) -> binder.bind("); //$NON-NLS-1$
				it.append(AbstractTypeScopeProvider.class);
				it.append(".class).toInstance("); //$NON-NLS-1$
				it.append(abstractAppender.getSimpleName());
				it.append(".this.scopeProvider));"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tfinal "); //$NON-NLS-1$
				it.append(IScopeProvider.class);
				it.append(" oldDelegate = this.typeScopes.getDelegate();"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tlocalInjector.injectMembers(this.typeScopes);"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\ttry {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\tfinal AppenderSerializer serializer = localInjector.getProvider(AppenderSerializer.class).get();"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\tserializer.serialize(object, appender, isFormatting());"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t} finally {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\ttry {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\t\tfinal "); //$NON-NLS-1$
				it.append(Field.class);
				it.append(" f = "); //$NON-NLS-1$
				it.append(DelegatingScopes.class);
				it.append(".class.getDeclaredField(\"delegate\");"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\t\tif (!f.isAccessible()) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\t\t\tf.setAccessible(true);"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\t\tf.set(this.typeScopes, oldDelegate);"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\t} catch ("); //$NON-NLS-1$
				it.append(Exception.class);
				it.append(" exception) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\t\tthrow new "); //$NON-NLS-1$
				it.append(Error.class);
				it.append("(exception);"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t} else {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tfinal AppenderSerializer serializer = this.originalInjector.getProvider(AppenderSerializer.class).get();"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tserializer.serialize(object, appender, isFormatting());"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\t@"); //$NON-NLS-1$
				it.append(Singleton.class);
				it.newLine();
				it.append("\tpublic static class AppenderSerializer extends "); //$NON-NLS-1$
				it.append(Serializer.class);
				it.append(" {"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\t\tpublic void serialize("); //$NON-NLS-1$
				it.append(EObject.class);
				it.append(" object, "); //$NON-NLS-1$
				it.append(ISourceAppender.class);
				it.append(" appender, boolean isFormatting) throws "); //$NON-NLS-1$
				it.append(IOException.class);
				it.append(" {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tfinal AppenderBasedTokenStream stream = new AppenderBasedTokenStream(appender);"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tfinal "); //$NON-NLS-1$
				it.append(SaveOptions.class);
				it.append(" options;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tif (isFormatting) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\toptions = "); //$NON-NLS-1$
				it.append(SaveOptions.class);
				it.append(".newBuilder().format().getOptions();"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t} else {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\toptions = "); //$NON-NLS-1$
				it.append(SaveOptions.class);
				it.append(".defaultOptions();"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tserialize(object, stream, options);"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tstream.flush();"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\t}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\tprivate static class AppenderBasedTokenStream extends "); //$NON-NLS-1$
				it.append(AbstractTokenStream.class);
				it.append(" {"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\t\tprivate final "); //$NON-NLS-1$
				it.append(ISourceAppender.class);
				it.append(" appender;"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\t\tpublic AppenderBasedTokenStream("); //$NON-NLS-1$
				it.append(ISourceAppender.class);
				it.append(" appender) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tthis.appender = appender;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\t\tpublic String toString() {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\treturn this.appender.toString();"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\t\tpublic void writeHidden("); //$NON-NLS-1$
				it.append(EObject.class);
				it.append(" grammarElement, String value) throws "); //$NON-NLS-1$
				it.append(IOException.class);
				it.append(" {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tif (!"); //$NON-NLS-1$
				it.append(Strings.class);
				it.append(".isEmpty(value)) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\tthis.appender.append(value);"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\t\tpublic void writeSemantic("); //$NON-NLS-1$
				it.append(EObject.class);
				it.append(" grammarElement, String value) throws "); //$NON-NLS-1$
				it.append(IOException.class);
				it.append(" {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tif (!"); //$NON-NLS-1$
				it.append(Strings.class);
				it.append(".isEmpty(value)) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\tthis.appender.append(value);"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\t}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\t/** Replies the type reference for the given name in the given context."); //$NON-NLS-1$
				it.newLine();
				it.append("\t */"); //$NON-NLS-1$
				it.newLine();
				it.append("\tpublic abstract "); //$NON-NLS-1$
				it.append(JvmParameterizedTypeReference.class);
				it.append(" newTypeRef(String typeName);"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\t/** Replies the type reference for the given name in the given context."); //$NON-NLS-1$
				it.newLine();
				it.append("\t */"); //$NON-NLS-1$
				it.newLine();
				it.append("\tpublic abstract "); //$NON-NLS-1$
				it.append(JvmParameterizedTypeReference.class);
				it.append(" newTypeRef("); //$NON-NLS-1$
				it.append(Notifier.class);
				it.append(" context, String typeName);"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
			}

		};
		JavaFileAccess javaFile = getFileAccessFactory().createJavaFile(abstractAppender, content);
		javaFile.writeTo(getSrcGen());
	}
646923
function createHTML(htmlStr) {
        var frag = document.createDocumentFragment(),
            temp = document.createElement('div');
        temp.innerHTML = htmlStr;
        while (temp.firstChild) {
            frag.appendChild(temp.firstChild);
        }
        return frag;
    }
798447
def insert_text(self,
	                text,
	                fname,
	                pattern=None,
	                expect=None,
	                shutit_pexpect_child=None,
	                before=False,
	                force=False,
	                note=None,
	                replace=False,
	                line_oriented=True,
	                create=True,
	                loglevel=logging.DEBUG):
		""""""
		shutit_global.shutit_global_object.yield_to_draw()
		return self.change_text(text=text,
		                        fname=fname,
		                        pattern=pattern,
		                        expect=expect,
		                        shutit_pexpect_child=shutit_pexpect_child,
		                        before=before,
		                        force=force,
		                        note=note,
		                        line_oriented=line_oriented,
		                        create=create,
		                        replace=replace,
		                        delete=False,
		                        loglevel=loglevel)
44604
public static String createUnquotedConstant(String str) {
        if (str == null || str.isEmpty()) {
            return str;
        }
        if (str.startsWith("\"")) {
            str = str.substring(1);
        }
        if (str.endsWith("\"")) {
            str = str.substring(0,
                                str.length() - 1);
        }
        return str;
    }
483326
function createText(value, data) {
  const node = { object: 'text', data };
  const leaves = isArray(value) ? value : [{ text: value }];
  return { ...node, leaves };
}
1240409
function transformSnippet(snippet, isImportant, syntax) {
		if (typeof snippet !== 'string') {
			snippet = snippet.data;
		}
		
		if (!isSingleProperty(snippet)) {
			return snippet;
		}
		
		if (isImportant) {
			if (~snippet.indexOf(';')) {
				snippet = snippet.split(';').join(' !important;');
			} else {
				snippet += ' !important';
			}
		}
		
		return formatProperty(snippet, syntax);
	}
1037378
private String getCodeSnippetHtml(Throwable cause) {
        StringBuilder codeSnippet = new StringBuilder();
        BufferedReader reader = null;
        
        try {
            if (cause instanceof CitrusRuntimeException) {
                CitrusRuntimeException ex = (CitrusRuntimeException) cause;
                if (!ex.getFailureStack().isEmpty()) {
                    FailureStackElement stackElement = ex.getFailureStack().pop();
                    if (stackElement.getLineNumberStart() > 0) {
                        reader = new BufferedReader(new FileReader(
                                new ClassPathResource(stackElement.getTestFilePath() + ".xml").getFile()));
                        
                        codeSnippet.append("<div class=\"code-snippet\">");
                        codeSnippet.append("<h2 class=\"code-title\">" + stackElement.getTestFilePath() + ".xml</h2>");
                        
                        String line;
                        String codeStyle;
                        int lineIndex = 1;
                        int snippetOffset = 5;
                        while ((line = reader.readLine()) != null) {
                            if (lineIndex >= stackElement.getLineNumberStart() - snippetOffset && 
                                    lineIndex < stackElement.getLineNumberStart() || 
                                    lineIndex > stackElement.getLineNumberEnd() && 
                                    lineIndex <= stackElement.getLineNumberEnd() + snippetOffset) {
                                codeStyle = "code";
                            } else if (lineIndex >= stackElement.getLineNumberStart() && 
                                    lineIndex <= stackElement.getLineNumberEnd()) {
                                codeStyle = "code-failed";
                            } else {
                                codeStyle = "";
                            }
                            
                            if (StringUtils.hasText(codeStyle)) {
                                codeSnippet.append("<pre class=\"" + codeStyle +"\"><span class=\"line-number\">" + lineIndex + ":</span>" + 
                                        line.replaceAll(">", "&gt;").replaceAll("<", "&lt;") + "</pre>");
                            }
                            
                            lineIndex++;
                            
                        }
                        
                        codeSnippet.append("</div>");
                    }
                }
            }
        } catch (IOException e) {
            log.error("Failed to construct HTML code snippet", e);
        } finally {
            if (reader != null) {
                try {
                    reader.close();
                } catch (IOException e) {
                    log.warn("Failed to close test file", e);
                }
            }
        }
        
        return codeSnippet.toString();
    }