private void render(HtmlBlock node, NodeFormatterContext context, MarkdownWriter markdown) { if (node.hasChildren()) { // inner blocks handle rendering context.renderChildren(node); } else { markdown.blankLine(); // TODO: this really needs to be parsed but we won't do it switch (context.getRenderPurpose()) { case TRANSLATION_SPANS: case TRANSLATED_SPANS: markdown.appendNonTranslating(myHtmlBlockPrefix, node.getChars().trimEOL(), ">", node.getChars().trimmedEOL()); break; case TRANSLATED: markdown.openPreFormatted(true); markdown.appendNonTranslating(node.getChars()); markdown.closePreFormatted(); break; case FORMAT: default: markdown.append(node.getChars()); } markdown.blankLine(); } }
HtmlBlockParser(DataHolder options, Pattern closingPattern, boolean isComment, HtmlDeepParser deepParser) { this.closingPattern = closingPattern; this.block = isComment ? new HtmlCommentBlock() : new HtmlBlock(); this.deepParser = deepParser; this.parseInnerHtmlComments = options.get(Parser.PARSE_INNER_HTML_COMMENTS); //this.htmlBlockDeepParser = options.get(Parser.HTML_BLOCK_DEEP_PARSER); this.myHtmlBlockDeepParseNonBlock = options.get(Parser.HTML_BLOCK_DEEP_PARSE_NON_BLOCK); this.myHtmlBlockDeepParseBlankLineInterrupts = options.get(Parser.HTML_BLOCK_DEEP_PARSE_BLANK_LINE_INTERRUPTS); this.myHtmlBlockDeepParseMarkdownInterruptsClosed = options.get(Parser.HTML_BLOCK_DEEP_PARSE_MARKDOWN_INTERRUPTS_CLOSED); this.myHtmlBlockDeepParseBlankLineInterruptsPartialTag = options.get(Parser.HTML_BLOCK_DEEP_PARSE_BLANK_LINE_INTERRUPTS_PARTIAL_TAG); this.myHtmlBlockDeepParseIndentedCodeInterrupts = options.get(Parser.HTML_BLOCK_DEEP_PARSE_INDENTED_CODE_INTERRUPTS); //this.myHtmlBlockDeepParseOpenTagsOnOneLine = options.get(Parser.HTML_BLOCK_DEEP_PARSE_FIRST_OPEN_TAG_ON_ONE_LINE); }
private void render(HtmlBlock node, NodeRendererContext context, HtmlWriter html) { if (node.hasChildren()) { // inner blocks handle rendering context.renderChildren(node); } else { renderHtmlBlock(node, context, html, context.getHtmlOptions().suppressHtmlBlocks, context.getHtmlOptions().escapeHtmlBlocks); } }
private void render(HtmlBlock node, final DocxRendererContext docx) { if (node.hasChildren()) { // inner blocks handle rendering docx.renderChildren(node); } else { renderHtmlBlock(node, docx, docx.getDocxRendererOptions().suppressHtmlBlocks, true || docx.getDocxRendererOptions().escapeHtmlBlocks); } }
@SuppressWarnings("MethodMayBeStatic") void render(HtmlBlock node, NodeRendererContext context, HtmlWriter html) { html.line(); final HtmlRendererOptions htmlOptions = context.getHtmlOptions(); if (htmlOptions.sourceWrapHtmlBlocks) { html.srcPos(node.getChars()).withAttr(AttributablePart.NODE_POSITION).tag("div").indent().line(); } if (node.hasChildren()) { // inner blocks handle rendering context.renderChildren(node); } else { renderHtmlBlock(node, context, html, htmlOptions.suppressHtmlBlocks, htmlOptions.escapeHtmlBlocks, false); } if (htmlOptions.sourceWrapHtmlBlocks) { html.unIndent().tag("/div"); } html.lineIf(htmlOptions.htmlBlockCloseTagEol); }
private void render(HtmlBlock node, NodeRendererContext context, HtmlWriter html) { if (node.hasChildren()) { // inner blocks handle rendering context.renderChildren(node); } else { renderHtmlBlock(node, context, html, context.getHtmlOptions().suppressHtmlBlocks, context.getHtmlOptions().escapeHtmlBlocks); } }
HtmlBlockParser(DataHolder options, Pattern closingPattern, boolean isComment, HtmlDeepParser deepParser) { this.closingPattern = closingPattern; this.block = isComment ? new HtmlCommentBlock() : new HtmlBlock(); this.deepParser = deepParser; this.parseInnerHtmlComments = options.get(Parser.PARSE_INNER_HTML_COMMENTS); //this.htmlBlockDeepParser = options.get(Parser.HTML_BLOCK_DEEP_PARSER); this.myHtmlBlockDeepParseNonBlock = options.get(Parser.HTML_BLOCK_DEEP_PARSE_NON_BLOCK); this.myHtmlBlockDeepParseBlankLineInterrupts = options.get(Parser.HTML_BLOCK_DEEP_PARSE_BLANK_LINE_INTERRUPTS); this.myHtmlBlockDeepParseMarkdownInterruptsClosed = options.get(Parser.HTML_BLOCK_DEEP_PARSE_MARKDOWN_INTERRUPTS_CLOSED); this.myHtmlBlockDeepParseBlankLineInterruptsPartialTag = options.get(Parser.HTML_BLOCK_DEEP_PARSE_BLANK_LINE_INTERRUPTS_PARTIAL_TAG); this.myHtmlBlockDeepParseIndentedCodeInterrupts = options.get(Parser.HTML_BLOCK_DEEP_PARSE_INDENTED_CODE_INTERRUPTS); //this.myHtmlBlockDeepParseOpenTagsOnOneLine = options.get(Parser.HTML_BLOCK_DEEP_PARSE_FIRST_OPEN_TAG_ON_ONE_LINE); }
private void render(HtmlBlock node, NodeFormatterContext context, MarkdownWriter markdown) { if (node.hasChildren()) { // inner blocks handle rendering context.renderChildren(node); } else { markdown.blankLine(); // TODO: this really needs to be parsed but we won't do it switch (context.getRenderPurpose()) { case TRANSLATION_SPANS: case TRANSLATED_SPANS: markdown.appendNonTranslating(myHtmlBlockPrefix, node.getChars().trimEOL(), ">", node.getChars().trimmedEOL()); break; case TRANSLATED: markdown.openPreFormatted(true); markdown.appendNonTranslating(node.getChars()); markdown.closePreFormatted(); break; case FORMAT: default: markdown.append(node.getChars()); } markdown.blankLine(); } }
private void render(HtmlBlock node, NodeRendererContext context, HtmlWriter html) { if (node.hasChildren()) { // inner blocks handle rendering context.renderChildren(node); } else { renderHtmlBlock(node, context, html, context.getHtmlOptions().suppressHtmlBlocks, context.getHtmlOptions().escapeHtmlBlocks); } }
@SuppressWarnings("MethodMayBeStatic") void render(HtmlBlock node, NodeRendererContext context, HtmlWriter html) { html.line(); final HtmlRendererOptions htmlOptions = context.getHtmlOptions(); if (htmlOptions.sourceWrapHtmlBlocks) { html.srcPos(node.getChars()).withAttr(AttributablePart.NODE_POSITION).tag("div").indent().line(); } if (node.hasChildren()) { // inner blocks handle rendering context.renderChildren(node); } else { renderHtmlBlock(node, context, html, htmlOptions.suppressHtmlBlocks, htmlOptions.escapeHtmlBlocks, false); } if (htmlOptions.sourceWrapHtmlBlocks) { html.unIndent().tag("/div"); } html.lineIf(htmlOptions.htmlBlockCloseTagEol); }