use of org.eclipse.mylyn.wikitext.html.internal.SubstitutionWithoutCssSpanStrategy in project mylyn.docs by eclipse.
the class SpanStrategiesTest method spanWithTextDecorationUnderlineToUnderlined.
@Test
public void spanWithTextDecorationUnderlineToUnderlined() {
SpanStrategies strategies = new SpanStrategies(Sets.newHashSet(SpanType.UNDERLINED), Collections.<SpanHtmlElementStrategy>emptyList());
SpanStrategy strategy = strategies.getStrategy(SpanType.SPAN, new Attributes(null, null, "text-decoration: underline;", null));
assertTrue(strategy instanceof SubstitutionWithoutCssSpanStrategy);
assertEquals(SpanType.UNDERLINED, ((SubstitutionWithoutCssSpanStrategy) strategy).getType());
}
use of org.eclipse.mylyn.wikitext.html.internal.SubstitutionWithoutCssSpanStrategy in project mylyn.docs by eclipse.
the class SpanStrategiesTest method spanWithFontWeightToBold.
@Test
public void spanWithFontWeightToBold() {
SpanStrategies strategies = new SpanStrategies(Sets.newHashSet(SpanType.BOLD), Collections.<SpanHtmlElementStrategy>emptyList());
SpanStrategy strategy = strategies.getStrategy(SpanType.SPAN, new Attributes(null, null, "font-weight: bold", null));
assertTrue(strategy instanceof SubstitutionWithoutCssSpanStrategy);
assertEquals(SpanType.BOLD, ((SubstitutionWithoutCssSpanStrategy) strategy).getType());
}
use of org.eclipse.mylyn.wikitext.html.internal.SubstitutionWithoutCssSpanStrategy in project mylyn.docs by eclipse.
the class SpanStrategiesTest method spanWithFontWeightToStrong.
@Test
public void spanWithFontWeightToStrong() {
SpanStrategies strategies = new SpanStrategies(Sets.newHashSet(SpanType.STRONG), Collections.<SpanHtmlElementStrategy>emptyList());
SpanStrategy strategy = strategies.getStrategy(SpanType.SPAN, new Attributes(null, null, "font-weight: bold", null));
assertTrue(strategy instanceof SubstitutionWithoutCssSpanStrategy);
assertEquals(SpanType.STRONG, ((SubstitutionWithoutCssSpanStrategy) strategy).getType());
}
use of org.eclipse.mylyn.wikitext.html.internal.SubstitutionWithoutCssSpanStrategy in project mylyn.docs by eclipse.
the class SubstitutionWithoutCssSpanStrategyTest method test.
@Test
public void test() {
SubstitutionWithoutCssSpanStrategy strategy = new SubstitutionWithoutCssSpanStrategy(SpanType.BOLD);
EventDocumentBuilder builder = new EventDocumentBuilder();
strategy.beginSpan(builder, SpanType.ITALIC, new Attributes("1", "class", "style", "lang"));
List<DocumentBuilderEvent> events = builder.getDocumentBuilderEvents().getEvents();
assertEquals(ImmutableList.of(new BeginSpanEvent(SpanType.BOLD, new Attributes("1", "class", null, "lang"))), events);
}
use of org.eclipse.mylyn.wikitext.html.internal.SubstitutionWithoutCssSpanStrategy in project mylyn.docs by eclipse.
the class CompositeSpanStrategyTest method test.
@Test
public void test() {
CompositeSpanStrategy strategy = new CompositeSpanStrategy(Lists.<SpanStrategy>newArrayList(new SubstitutionWithoutCssSpanStrategy(SpanType.BOLD), new SubstitutionWithoutCssSpanStrategy(SpanType.ITALIC)));
EventDocumentBuilder builder = new EventDocumentBuilder();
strategy.beginSpan(builder, SpanType.DELETED, new Attributes());
strategy.endSpan(builder);
DocumentBuilderEvents events = builder.getDocumentBuilderEvents();
assertEquals(ImmutableList.of(new BeginSpanEvent(SpanType.BOLD, new Attributes()), new BeginSpanEvent(SpanType.ITALIC, new Attributes()), new EndSpanEvent(), new EndSpanEvent()), events.getEvents());
}
Aggregations