Search in sources :

Example 6 with ConfluenceLanguage

use of org.eclipse.mylyn.wikitext.confluence.ConfluenceLanguage in project mylyn.docs by eclipse.

the class FastMarkupPartitionerTest method testConfluenceTipException_bug273100.

/**
 * test for bug 273100
 */
public void testConfluenceTipException_bug273100() {
    IDocument document = new Document();
    FastMarkupPartitioner partitioner = new FastMarkupPartitioner();
    partitioner.setMarkupLanguage(new ConfluenceLanguage());
    document.set("{tip}\ntext1\n\ntext2\n\ntext3\n{tip}\ntext4\n");
    partitioner.connect(document);
    document.setDocumentPartitioner(partitioner);
}
Also used : ConfluenceLanguage(org.eclipse.mylyn.wikitext.confluence.ConfluenceLanguage) Document(org.eclipse.jface.text.Document) IDocument(org.eclipse.jface.text.IDocument) IDocument(org.eclipse.jface.text.IDocument)

Example 7 with ConfluenceLanguage

use of org.eclipse.mylyn.wikitext.confluence.ConfluenceLanguage in project mylyn.docs by eclipse.

the class FastMarkupPartitionerTest method testConfluenceColor.

/**
 * test color
 */
public void testConfluenceColor() {
    IDocument document = new Document();
    FastMarkupPartitioner partitioner = new FastMarkupPartitioner();
    partitioner.setMarkupLanguage(new ConfluenceLanguage());
    document.set("{color:red}\ntext1\n\ntext2{color}\ntext3\n");
    // ...........012345678901.234567.8.9012345678901.234567.
    // .....................10...........20.........30.......
    partitioner.connect(document);
    document.setDocumentPartitioner(partitioner);
    // MarkupPartition(type=DIV,offset=0,length=12,end=12)
    // MarkupPartition(type=PARAGRAPH,offset=12,length=7,end=19)
    // MarkupPartition(type=PARAGRAPH,offset=19,length=13,end=32)
    // MarkupPartition(type=PARAGRAPH,offset=32,length=6,end=38)
    int[][] expected = new int[][] { // 
    { 0, 12 }, // 
    { 12, 7 }, // 
    { 19, 13 }, // 
    { 32, 6 } };
    ITypedRegion[] partitioning = partitioner.computePartitioning(0, document.getLength(), false);
    assertPartitioningAsExpected(expected, partitioning);
}
Also used : ConfluenceLanguage(org.eclipse.mylyn.wikitext.confluence.ConfluenceLanguage) ITypedRegion(org.eclipse.jface.text.ITypedRegion) Document(org.eclipse.jface.text.Document) IDocument(org.eclipse.jface.text.IDocument) IDocument(org.eclipse.jface.text.IDocument)

Example 8 with ConfluenceLanguage

use of org.eclipse.mylyn.wikitext.confluence.ConfluenceLanguage in project mylyn.docs by eclipse.

the class DocBookDocumentBuilderIntegrationTest method testInlineQuote.

public void testInlineQuote() {
    parser.setMarkupLanguage(new ConfluenceLanguage());
    parser.parse("some text {quote}quoted text{quote} some text");
    String docbook = out.toString();
    String expectedContent = "<para>some text <quote>quoted text</quote> some text</para>";
    assertEquals(DOCBOOK_BEGIN + expectedContent + DOCBOOK_END, docbook);
}
Also used : ConfluenceLanguage(org.eclipse.mylyn.wikitext.confluence.ConfluenceLanguage)

Aggregations

ConfluenceLanguage (org.eclipse.mylyn.wikitext.confluence.ConfluenceLanguage)8 Document (org.eclipse.jface.text.Document)4 IDocument (org.eclipse.jface.text.IDocument)4 ITypedRegion (org.eclipse.jface.text.ITypedRegion)2 Attributes (org.eclipse.mylyn.wikitext.parser.Attributes)2 Matcher (java.util.regex.Matcher)1 Block (org.eclipse.mylyn.wikitext.parser.markup.Block)1 OutlineItem (org.eclipse.mylyn.wikitext.parser.outline.OutlineItem)1 OutlineParser (org.eclipse.mylyn.wikitext.parser.outline.OutlineParser)1