use of org.eclipse.mylyn.wikitext.markdown.MarkdownLanguage in project mylyn.docs by eclipse.
the class MarkdownLanguageTest method testIdGenerationStrategy.
public void testIdGenerationStrategy() {
IdGenerationStrategy strategy = new MarkdownLanguage().getIdGenerationStrategy();
assertNotNull(strategy);
assertEquals(GfmIdGenerationStrategy.class, strategy.getClass());
}
use of org.eclipse.mylyn.wikitext.markdown.MarkdownLanguage in project mylyn.docs by eclipse.
the class LinkDefinitionValidationRule method findProblems.
@Override
public List<ValidationProblem> findProblems(String markup, int offset, int length) {
MarkupParser parser = new MarkupParser(new MarkdownLanguage());
MarkdownContentStateDocumentBuilder builder = new MarkdownContentStateDocumentBuilder();
parser.setBuilder(builder);
parser.parse(markup);
MarkdownContentState markdownContentState = builder.markdownContentState;
LinkDefinitionUsageTracker linkDefinitionUsageTracker = markdownContentState.getLinkDefinitionUsageTracker();
List<ValidationProblem> problems = new ArrayList<ValidationProblem>();
List<Position> missingLinkDefinitionPositions = linkDefinitionUsageTracker.getMissingLinkDefinitionPositions();
for (Position position : missingLinkDefinitionPositions) {
problems.add(new ValidationProblem(Severity.ERROR, MessageFormat.format(// $NON-NLS-1$
Messages.getString("LinkDefinitionValidationRule.missing"), position.getId()), position.getOffset(), position.getLength()));
}
List<Position> unusedLinkDefinitionPositions = linkDefinitionUsageTracker.getUnusedLinkDefinitionPositions();
for (Position position : unusedLinkDefinitionPositions) {
problems.add(new ValidationProblem(Severity.WARNING, MessageFormat.format(// $NON-NLS-1$
Messages.getString("LinkDefinitionValidationRule.unused"), position.getId()), position.getOffset(), position.getLength()));
}
return problems;
}
use of org.eclipse.mylyn.wikitext.markdown.MarkdownLanguage in project mylyn.docs by eclipse.
the class MarkdownLanguageTestBase method setUp.
@Override
public void setUp() throws Exception {
super.setUp();
parser = new MarkupParser(new MarkdownLanguage());
}
use of org.eclipse.mylyn.wikitext.markdown.MarkdownLanguage in project mylyn.docs by eclipse.
the class MarkdownLanguageTest method testDiscoverable.
public void testDiscoverable() {
MarkupLanguage language = ServiceLocator.getInstance().getMarkupLanguage("Markdown");
assertNotNull(language);
assertTrue(language instanceof MarkdownLanguage);
}
use of org.eclipse.mylyn.wikitext.markdown.MarkdownLanguage in project mylyn.docs by eclipse.
the class MarkdownLanguageTest method testCreateDocumentBuilder.
public void testCreateDocumentBuilder() {
AbstractMarkupLanguage lang = new MarkdownLanguage();
DocumentBuilder builder = lang.createDocumentBuilder(new StringWriter());
assertNotNull(builder);
assertTrue(builder instanceof MarkdownDocumentBuilder);
}
Aggregations