use of org.eclipse.mylyn.wikitext.html.internal.SpanStrategy 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.SpanStrategy 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.SpanStrategy 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.SpanStrategy in project mylyn.docs by eclipse.
the class SpanStrategiesTest method spanWithTextDecorationLinethroughToDeleted.
@Test
public void spanWithTextDecorationLinethroughToDeleted() {
SpanStrategies strategies = new SpanStrategies(Sets.newHashSet(SpanType.DELETED), Collections.<SpanHtmlElementStrategy>emptyList());
SpanStrategy strategy = strategies.getStrategy(SpanType.SPAN, new Attributes(null, null, "text-decoration: line-through;", null));
assertTrue(strategy instanceof SubstitutionWithoutCssSpanStrategy);
assertEquals(SpanType.DELETED, ((SubstitutionWithoutCssSpanStrategy) strategy).getType());
}
use of org.eclipse.mylyn.wikitext.html.internal.SpanStrategy in project mylyn.docs by eclipse.
the class FontElementStrategyTest method spanStrategyBuildsNonHtml.
@Test
public void spanStrategyBuildsNonHtml() {
EventDocumentBuilder builder = new EventDocumentBuilder();
SpanStrategy spanStrategy = strategy.spanStrategy();
spanStrategy.beginSpan(builder, SpanType.SPAN, new Attributes(null, null, "color: red", null));
builder.characters("test");
spanStrategy.endSpan(builder);
assertEquals(Arrays.asList(new BeginSpanEvent(SpanType.SPAN, new Attributes(null, null, "color: red", null)), new CharactersEvent("test"), new EndSpanEvent()), builder.getDocumentBuilderEvents().getEvents());
}
Aggregations