public class HtmlLanguage extends MarkupLanguage
MarkupLanguage
for handling HTML.
The HtmlLanguage
maps block types as follows:
DocumentBuilder.BlockType.BULLETED_LIST
maps to HTML tag <ul>
DocumentBuilder.BlockType.CODE
maps to HTML tags <pre><code>
DocumentBuilder.BlockType.DEFINITION_LIST
maps to HTML tag <dl>
DocumentBuilder.BlockType.DEFINITION_ITEM
maps to HTML tag <dd>
DocumentBuilder.BlockType.DEFINITION_TERM
maps to HTML tag <dt>
DocumentBuilder.BlockType.DIV
maps to HTML tag <div>
DocumentBuilder.BlockType.LIST_ITEM
maps to HTML tag <li>
DocumentBuilder.BlockType.NUMERIC_LIST
maps to HTML tag <ol>
DocumentBuilder.BlockType.PARAGRAPH
maps to HTML tag <p>
DocumentBuilder.BlockType.PREFORMATTED
maps to HTML tag <pre>
DocumentBuilder.BlockType.QUOTE
maps to HTML tag <blockquote>
DocumentBuilder.BlockType.TABLE
maps to HTML tag <table>
DocumentBuilder.BlockType.TABLE_CELL_HEADER
maps to HTML tag <th>
DocumentBuilder.BlockType.TABLE_CELL_NORMAL
maps to HTML tag <td>
DocumentBuilder.BlockType.TABLE_ROW
maps to HTML tag <tr>
The HtmlLanguage
maps span types as follows:
DocumentBuilder.SpanType.BOLD
maps to HTML tag <b>
DocumentBuilder.SpanType.CITATION
maps to HTML tag <cite>
DocumentBuilder.SpanType.CODE
maps to HTML tag <code>
DocumentBuilder.SpanType.DELETED
maps to HTML tag <del>
DocumentBuilder.SpanType.EMPHASIS
maps to HTML tag <em>
DocumentBuilder.SpanType.INSERTED
maps to HTML tag <ins>
DocumentBuilder.SpanType.ITALIC
maps to HTML tag <i>
DocumentBuilder.SpanType.LINK
maps to HTML tag <a>
DocumentBuilder.SpanType.MONOSPACE
maps to HTML tag <tt>
DocumentBuilder.SpanType.QUOTE
maps to HTML tag <q>
DocumentBuilder.SpanType.SPAN
maps to HTML tag <span>
DocumentBuilder.SpanType.STRONG
maps to HTML tag <strong>
DocumentBuilder.SpanType.SUBSCRIPT
maps to HTML tag <sub>
DocumentBuilder.SpanType.SUPERSCRIPT
maps to HTML tag <sup>
DocumentBuilder.SpanType.UNDERLINED
maps to HTML tag <u>
HtmlLanguage
variants created using HtmlLanguageBuilder
may map DocumentBuilder.SpanType
and
DocumentBuilder.BlockType
differently.
HtmlParser
,
HtmlLanguageBuilder
,
builder()
Constructor and Description |
---|
HtmlLanguage() |
Modifier and Type | Method and Description |
---|---|
static HtmlLanguageBuilder |
builder()
Creates a
HtmlLanguageBuilder . |
HtmlLanguage |
clone() |
DocumentBuilder |
createDocumentBuilder(java.io.Writer out,
boolean formatting)
Creates a
DocumentBuilder suitable for emitting content in this markup language. |
boolean |
isParseCleansHtml()
Indicates if
parsing is run with cleanup rules for HTML. |
void |
processContent(MarkupParser parser,
java.lang.String markupContent,
boolean asDocument) |
void |
setParseCleansHtml(boolean parseCleansHtml)
Set whether
parsing is run with cleanup rules for HTML. |
configure, createDocumentBuilder, getExtendsLanguage, getFileExtensions, getIdGenerationStrategy, getName, setExtendsLanguage, setFileExtensions, setName
public boolean isParseCleansHtml()
parsing
is run with cleanup rules for HTML.
Defaults to true
.HtmlParser.instanceWithHtmlCleanupRules()
public void setParseCleansHtml(boolean parseCleansHtml)
parsing
is run with cleanup rules for HTML.parseCleansHtml
- true if cleanup rules are used when parsing, otherwise falseisParseCleansHtml()
,
HtmlParser.instanceWithHtmlCleanupRules()
public void processContent(MarkupParser parser, java.lang.String markupContent, boolean asDocument)
processContent
in class MarkupLanguage
public DocumentBuilder createDocumentBuilder(java.io.Writer out, boolean formatting)
MarkupLanguage
DocumentBuilder
suitable for emitting content in this markup language.createDocumentBuilder
in class MarkupLanguage
out
- the target to which content is writtenformatting
- indicates if the builder should format the output using pretty-print rules. If not supported by the
document builder this parameter is ignored.public static HtmlLanguageBuilder builder()
HtmlLanguageBuilder
.HtmlLanguageBuilder
public HtmlLanguage clone()
clone
in class MarkupLanguage
Copyright © 2007, 2013 David Green and others.
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
which accompanies this distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html