parser

package
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 13, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package parser provides HTML parsing functionality for the readability library.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseHTML

func ParseHTML(htmlContent string, baseURI string) (*dom.VDocument, error)

ParseHTML parses an HTML string and returns a virtual DOM document. It uses golang.org/x/net/html for parsing and converts the result to our internal DOM structure.

func SerializeDocumentToHTML

func SerializeDocumentToHTML(doc *dom.VDocument) string

SerializeDocumentToHTML converts a virtual DOM document to an HTML string.

func SerializeDocumentToWriter

func SerializeDocumentToWriter(doc *dom.VDocument, w io.Writer) error

SerializeDocumentToWriter writes the HTML representation of a document to a writer.

func SerializeToHTML

func SerializeToHTML(node dom.VNode) string

SerializeToHTML converts a virtual DOM element to an HTML string.

func SerializeToWriter

func SerializeToWriter(node dom.VNode, w io.Writer) error

SerializeToWriter writes the HTML representation of a node to a writer.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL