when(htmlField.getHTML()).thenReturn("some<b>html"); when(container.getHtml("html")).thenReturn(htmlField);
String content = item.getHTML(); LinkType linkType = getLinkType(env); return linkReplacer.replace(gc, null, null, content, linkType, gc.getProject().getName(), Arrays.asList(container.getLanguageTag()));
HtmlGraphField htmlField = container.getHtml(name); if (htmlField != null) { String value = htmlField.getHTML(); if (value != null) { String plainValue = Jsoup.parse(value).text(); List<String> htmlItems = new ArrayList<>(); for (HtmlGraphField listItem : graphHtmlList.getList()) { String value = listItem.getHTML(); if (value != null) { String plainValue = Jsoup.parse(value).text();
public GraphQLFieldDefinition createHtmlDef(FieldSchema schema) { return newFieldDefinition().name(schema.getName()).description(schema.getLabel()).type(GraphQLString).argument(createLinkTypeArg()) .dataFetcher(env -> { GraphFieldContainer container = env.getSource(); HtmlGraphField htmlField = container.getHtml(schema.getName()); if (htmlField != null) { GraphQLContext gc = env.getContext(); LinkType type = getLinkType(env); String content = htmlField.getHTML(); return linkReplacer.replace(gc, gc.getBranch() .getUuid(), null, content, type, gc.getProject().getName(), Arrays.asList(container.getLanguageTag())); } return null; }).build(); }