classafFandoc::HtmlDocWriter
sys::Obj afFandoc::HtmlDocWriter : afFandoc::DocWriter
@
Js
A intelligent DocWriter
with useful method override hooks. Links that cannot be resolved are rendered with an invalidLink
CSS class and pre
blocks are processed
- attr
virtual Void attr(OutStream out, Str key, Obj? val)
Writes out an HTML attribute. If
val
isnull
a HTML5 Boolean attribute is written out. Ifval
is aUri
then it's encoded form is written out. Elseval.toStr
is used.All attribute values are XML escaped.
- cssClasses
- escapeText
virtual override Str escapeText(DocElem elem, Str text)
Escapes the given text to XML, unless we're inside a
pre
block.- fullyLoaded
static HtmlDocWriter fullyLoaded()
A HTML writer that performs pre-block-processing for tables and syntax colouring.
- isVoidElem
virtual Bool isVoidElem(DocElem elem)
Special end-tag handling for Void Elements. See Void Elements in the W3C HTML5 specification.
- linkResolvers
LinkResolver[] linkResolvers := LinkResolver[,]
- original
static HtmlDocWriter original()
A simple HTML writer that mimics the original; no invalid links and no pre-block-processing.
- preProcessors
Str:PreProcessor preProcessors := [Str:PreProcessor][:]
- renderAttrs
virtual Void renderAttrs(OutStream out, DocElem elem)
Renders some standard element attributes, i.e.
src
andalt
forimg
tags.Renders an
id
attribute should the element'sanchorId
not be null.- renderClass
virtual Void renderClass(OutStream out, DocElem elem)
Writes out
class
attributes for some common scenarios.- renderElem
virtual Void renderElem(OutStream out, DocElem elem, Str body)
Invokes a
PreProcessor
should a matching one be found, else defaults to callingrenderElem()
.- renderPreBody
virtual Void renderPreBody(OutStream out, DocElem elem, Str body)
Invokes a
PreProcessor
should a matching one be found, else defaults to callingrenderElem()
.- resolveLink
virtual Uri? resolveLink(DocElem elem, Str url)
Calls the
LinkResolvers
looking for valid links.