Package org.jsoup.nodes

Examples of org.jsoup.nodes.Document.body()


   * @since 1.0
   */
  public static Element parseBodyFragment(String content) {

    Document doc = Jsoup.parseBodyFragment(content);
    return doc.body();
  }
 
}
View Full Code Here


                if (isLocalURI(uri) && isMarkdownPath(uri.getPath())) {
                    link.attr("href", makeHtmlPath(uri));
                }
            }
        }
        return doc.body().html();
    }

    private boolean isLocalURI(URI uri) {
        return !uri.isAbsolute() && isBlank(uri.getAuthority()) && isBlank(uri.getQuery());
    }
View Full Code Here

        .appendElement("script")
        .attr("type", "text/javascript")
        .text("function woopraReady(tracker) {tracker.setDomain('lastcalc.com');tracker.setIdleTimeout(300000);tracker.track();return false;}(function(){var wsc = document.createElement('script');wsc.src = document.location.protocol+'//static.woopra.com/js/woopra.js';wsc.type = 'text/javascript';wsc.async = true;var ssc = document.getElementsByTagName('script')[0];ssc.parentNode.insertBefore(wsc, ssc);})();");

        doc.head().append("<script type=\"text/javascript\"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-354970-27']); _gaq.push(['_trackPageview']);(function() {var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);})();</script>");
        doc.body().attr("data-worksheet-id", worksheet.id);
        doc.body().attr("data-worksheet-ro-id", worksheet.readOnlyId);
        final Element header = doc.body().appendElement("div").attr("id", "header");
        header.appendElement("div").attr("id", "logo").text("LastCalc");
        header.appendElement("div").attr("id", "help-button").text("Show Help");
        final Element ws = doc.body().appendElement("div").attr("id", "worksheet");
View Full Code Here

        .attr("type", "text/javascript")
        .text("function woopraReady(tracker) {tracker.setDomain('lastcalc.com');tracker.setIdleTimeout(300000);tracker.track();return false;}(function(){var wsc = document.createElement('script');wsc.src = document.location.protocol+'//static.woopra.com/js/woopra.js';wsc.type = 'text/javascript';wsc.async = true;var ssc = document.getElementsByTagName('script')[0];ssc.parentNode.insertBefore(wsc, ssc);})();");

        doc.head().append("<script type=\"text/javascript\"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-354970-27']); _gaq.push(['_trackPageview']);(function() {var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);})();</script>");
        doc.body().attr("data-worksheet-id", worksheet.id);
        doc.body().attr("data-worksheet-ro-id", worksheet.readOnlyId);
        final Element header = doc.body().appendElement("div").attr("id", "header");
        header.appendElement("div").attr("id", "logo").text("LastCalc");
        header.appendElement("div").attr("id", "help-button").text("Show Help");
        final Element ws = doc.body().appendElement("div").attr("id", "worksheet");
        ws.appendElement("div").attr("class", "groups").appendElement("a")
View Full Code Here

        .text("function woopraReady(tracker) {tracker.setDomain('lastcalc.com');tracker.setIdleTimeout(300000);tracker.track();return false;}(function(){var wsc = document.createElement('script');wsc.src = document.location.protocol+'//static.woopra.com/js/woopra.js';wsc.type = 'text/javascript';wsc.async = true;var ssc = document.getElementsByTagName('script')[0];ssc.parentNode.insertBefore(wsc, ssc);})();");

        doc.head().append("<script type=\"text/javascript\"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-354970-27']); _gaq.push(['_trackPageview']);(function() {var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);})();</script>");
        doc.body().attr("data-worksheet-id", worksheet.id);
        doc.body().attr("data-worksheet-ro-id", worksheet.readOnlyId);
        final Element header = doc.body().appendElement("div").attr("id", "header");
        header.appendElement("div").attr("id", "logo").text("LastCalc");
        header.appendElement("div").attr("id", "help-button").text("Show Help");
        final Element ws = doc.body().appendElement("div").attr("id", "worksheet");
        ws.appendElement("div").attr("class", "groups").appendElement("a")
        .attr("href", "https://github.com/sanity/LastCalc/wiki")
View Full Code Here

        doc.body().attr("data-worksheet-id", worksheet.id);
        doc.body().attr("data-worksheet-ro-id", worksheet.readOnlyId);
        final Element header = doc.body().appendElement("div").attr("id", "header");
        header.appendElement("div").attr("id", "logo").text("LastCalc");
        header.appendElement("div").attr("id", "help-button").text("Show Help");
        final Element ws = doc.body().appendElement("div").attr("id", "worksheet");
        ws.appendElement("div").attr("class", "groups").appendElement("a")
        .attr("href", "https://github.com/sanity/LastCalc/wiki")
        .attr("target", "_blank").html("LastCalc is open source!  Read more...");
        return doc;
    }
View Full Code Here

        // doc.body().appendElement("iframe").attr("id",
        // "helpframe").attr("src", "/help")
        // .attr("frameBorder", "0");

        final Element helpDiv = doc.body().appendElement("div").attr("id", "helpframe")
            .attr("style", "display: none;");
        for (final Node n : Help.getHelpDoc().body().childNodes()) {
          helpDiv.appendChild(n.clone());
        }
View Full Code Here

          helpDiv.appendChild(n.clone());
        }

        int lineNo = 1;
        final SequentialParser sp = SequentialParser.create();
                Element worksheetElement = doc.body().select("#worksheet").first();
        for (final Line qa : worksheet.qaPairs) {
          sp.processNextAnswer(qa.answer);
          final Element lineEl = worksheetElement.appendElement("div").addClass("line")
              .attr("id", "line" + lineNo);
          if (lineNo == 1) {
View Full Code Here

            .html("<span style=\"font-size:10pt;\">&#10003</span>");
            lineEl.appendElement("div").attr("class", "answer");
          }
          lineNo++;
        }
        doc.body().attr("data-variables", Misc.gson.toJson(sp.getUserDefinedKeywordMap()));
        final Element lineEl = worksheetElement.appendElement("div").addClass("line").attr("id", "line" + lineNo);
        if (lineNo == 1) {
          lineEl.addClass("firstLine");
        }
        final Element lineNumber=lineEl.appendElement("div").attr("class","lineNumberMarker");
View Full Code Here

        whitelist.addAttributes(":all", "on");
        Document dirty = Jsoup.parseBodyFragment(html, "");
        SishuokCleaner cleaner = new SishuokCleaner(whitelist);
        Document clean = cleaner.clean(dirty);

        return clean.body().html();
    }

    /**
     * 删除指定标签
     *
 
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.