Package org.jsoup.nodes

Examples of org.jsoup.nodes.Element


        String content = asciidoctor.renderFile(new File("target/test-classes/sample-with-uri-include.ad"), options()
                .toFile(false).get());

        Document doc = Jsoup.parse(content, "UTF-8");

        Element contentElement = doc.getElementsByAttributeValue("class", "language-ruby").first();

        assertThat(contentElement.text(), startsWith("source 'https://rubygems.org"));

    }
View Full Code Here


        String content = asciidoctor.renderFile(new File("target/test-classes/sample-with-terminal-command.ad"),
                options().toFile(false).get());

        Document doc = Jsoup.parse(content, "UTF-8");

        Element contentElement = doc.getElementsByAttributeValue("class", "command").first();
        assertThat(contentElement.text(), is("echo \"Hello, World!\""));

        contentElement = doc.getElementsByAttributeValue("class", "command").last();
        assertThat(contentElement.text(), is("gem install asciidoctor"));

    }
View Full Code Here

        String content = asciidoctor.renderFile(new File("target/test-classes/sample-with-terminal-command.ad"),
                options().toFile(false).get());

        Document doc = Jsoup.parse(content, "UTF-8");

        Element contentElement = doc.getElementsByAttributeValue("class", "command").first();
        assertThat(contentElement.text(), is("echo \"Hello, World!\""));

        contentElement = doc.getElementsByAttributeValue("class", "command").last();
        assertThat(contentElement.text(), is("gem install asciidoctor"));

    }
View Full Code Here

        String content = asciidoctor.renderFile(new File("target/test-classes/sample-with-terminal-command.ad"),
                options().toFile(false).get());

        Document doc = Jsoup.parse(content, "UTF-8");

        Element contentElement = doc.getElementsByAttributeValue("class", "command").first();
        assertThat(contentElement.text(), is("echo \"Hello, World!\""));

        contentElement = doc.getElementsByAttributeValue("class", "command").last();
        assertThat(contentElement.text(), is("gem install asciidoctor"));

    }
View Full Code Here

        asciidoctor.renderFile(new File("target/test-classes/arrows-and-boxes-example.ad"), options);

        File renderedFile = new File(testFolder.getRoot(), "rendersample.html");
        Document doc = Jsoup.parse(renderedFile, "UTF-8");

        Element arrowsJs = doc.select("script[src=http://www.headjump.de/javascripts/arrowsandboxes.js").first();
        assertThat(arrowsJs, is(notNullValue()));

        Element arrowsCss = doc.select("link[href=http://www.headjump.de/stylesheets/arrowsandboxes.css").first();
        assertThat(arrowsCss, is(notNullValue()));

        Element arrowsAndBoxes = doc.select("pre[class=arrows-and-boxes").first();
        assertThat(arrowsAndBoxes, is(notNullValue()));

    }
View Full Code Here

        String content = asciidoctor.renderFile(new File("target/test-classes/sample-with-gist-macro.ad"), options()
                .toFile(false).get());

        Document doc = Jsoup.parse(content, "UTF-8");
        Element script = doc.getElementsByTag("script").first();

        assertThat(script.attr("src"), is("https://gist.github.com/123456.js"));
    }
View Full Code Here

        String content = asciidoctor.renderFile(new File("target/test-classes/sample-with-gist-macro.ad"), options()
                .toFile(false).get());

        Document doc = Jsoup.parse(content, "UTF-8");
        Element script = doc.getElementsByTag("script").first();

        assertThat(script.attr("src"), is("https://gist.github.com/123456.js"));
    }
View Full Code Here

        String content = asciidoctor.renderFile(new File("target/test-classes/sample-with-gist-macro.ad"), options()
                .toFile(false).get());

        Document doc = Jsoup.parse(content, "UTF-8");
        Element script = doc.getElementsByTag("script").first();

        assertThat(script.attr("src"), is("https://gist.github.com/123456.js"));
    }
View Full Code Here

        String content = asciidoctor.renderFile(new File("target/test-classes/sample-with-man-link.ad"), options()
                .toFile(false).get());

        Document doc = Jsoup.parse(content, "UTF-8");
        Element link = doc.getElementsByTag("a").first();
        assertThat(link.attr("href"), is("gittutorial.html"));
    }
View Full Code Here

        String content = asciidoctor.renderFile(new File("target/test-classes/sample-with-man-link.ad"), options()
                .toFile(false).get());

        Document doc = Jsoup.parse(content, "UTF-8");
        Element link = doc.getElementsByTag("a").first();
        assertThat(link.attr("href"), is("gittutorial.html"));

    }
View Full Code Here

TOP

Related Classes of org.jsoup.nodes.Element

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.