printer/html2text/html2text.go
author Mikael Berthe <mikael@lilotux.net>
Fri, 12 May 2017 23:31:21 +0200
changeset 126 7d712d2bde73
child 132 4bf4f6ce268e
permissions -rw-r--r--
Much improved html2text (fromhtml) Handles tags and mentions specifically; display the URL in the other cases.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
126
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
     1
// Copyright (c) 2015 Shawn Goertzen
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
     2
// Copyright (c) 2017 Mikael Berthe
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
     3
//
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
     4
// This code mostly comes from github.com/sgoertzen/html2text,
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
     5
// with some specific but intrusive changes for Mastodon HTML messages.
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
     6
// For example, links are not displayed for hashtags and mentions,
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
     7
// and links alone are displayed for the other cases.
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
     8
//
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
     9
// Licensed under the MIT license.
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    10
// Please see the LICENSE file is this directory.
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    11
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    12
package html2text
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    13
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    14
import (
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    15
	"bytes"
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    16
	"errors"
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    17
	"golang.org/x/net/html"
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    18
	"strings"
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    19
)
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    20
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    21
var breakers = map[string]bool{
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    22
	"br":  true,
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    23
	"div": true,
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    24
	"tr":  true,
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    25
	"li":  true,
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    26
	"p":   true,
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    27
}
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    28
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    29
// Textify turns an HTML body into a text string
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    30
func Textify(body string) (string, error) {
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    31
	r := strings.NewReader(body)
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    32
	doc, err := html.Parse(r)
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    33
	if err != nil {
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    34
		return "", errors.New("unable to parse the html")
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    35
	}
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    36
	var buffer bytes.Buffer
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    37
	process(doc, &buffer, "")
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    38
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    39
	s := strings.TrimSpace(buffer.String())
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    40
	return s, nil
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    41
}
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    42
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    43
func process(n *html.Node, b *bytes.Buffer, class string) {
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    44
	processChildren := true
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    45
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    46
	if n.Type == html.ElementNode && n.Data == "head" {
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    47
		return
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    48
	} else if n.Type == html.ElementNode && n.Data == "a" && n.FirstChild != nil {
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    49
		anchor(n, b, class)
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    50
		processChildren = false
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    51
	} else if n.Type == html.TextNode {
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    52
		// Clean up data
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    53
		cleanData := strings.Replace(strings.Trim(n.Data, " \t"), "\u00a0", " ", -1)
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    54
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    55
		// Heuristics to add a whitespace character...
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    56
		var prevSpace, nextSpace bool // hint if previous/next char is a space
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    57
		var last byte
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    58
		bl := b.Len()
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    59
		if bl > 0 {
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    60
			last = b.Bytes()[bl-1]
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    61
			if last == ' ' {
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    62
				prevSpace = true
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    63
			}
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    64
		}
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    65
		if len(cleanData) > 0 && cleanData[0] == ' ' {
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    66
			nextSpace = true
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    67
		}
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    68
		if prevSpace && nextSpace {
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    69
			b.WriteString(cleanData[1:]) // Trim 1 space
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    70
		} else {
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    71
			if bl > 0 && last != '\n' && last != '@' && last != '#' && !prevSpace && !nextSpace {
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    72
				b.WriteString(" ")
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    73
			}
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    74
			b.WriteString(cleanData)
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    75
		}
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    76
	}
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    77
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    78
	if processChildren {
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    79
		var class string
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    80
		if n.Type == html.ElementNode && n.Data == "span" {
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    81
			for _, attr := range n.Attr {
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    82
				if attr.Key == "class" {
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    83
					class = attr.Val
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    84
					break
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    85
				}
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    86
			}
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    87
		}
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    88
		for c := n.FirstChild; c != nil; c = c.NextSibling {
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    89
			process(c, b, class)
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    90
		}
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    91
	}
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    92
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    93
	if b.Len() > 0 {
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    94
		bl := b.Len()
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    95
		last := b.Bytes()[bl-1]
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    96
		if last != '\n' && n.Type == html.ElementNode && breakers[n.Data] {
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    97
			// Remove previous space
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    98
			for last == ' ' {
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    99
				bl--
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   100
				b.Truncate(bl)
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   101
				if bl > 0 {
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   102
					last = b.Bytes()[bl-1]
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   103
				} else {
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   104
					last = '\x00'
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   105
				}
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   106
			}
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   107
			b.WriteString("\n")
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   108
		}
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   109
	}
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   110
}
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   111
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   112
func anchor(n *html.Node, b *bytes.Buffer, class string) {
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   113
	bl := b.Len()
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   114
	var last byte
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   115
	if bl > 0 {
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   116
		last = b.Bytes()[bl-1]
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   117
	}
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   118
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   119
	var tmpbuf bytes.Buffer
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   120
	for c := n.FirstChild; c != nil; c = c.NextSibling {
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   121
		process(c, &tmpbuf, class)
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   122
	}
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   123
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   124
	if class == "tag" || class == "h-card" || last == '@' {
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   125
		b.Write(tmpbuf.Bytes())
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   126
		return
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   127
	}
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   128
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   129
	// Add heading space if needed
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   130
	if last != ' ' && last != '\n' {
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   131
		b.WriteString(" ")
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   132
	}
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   133
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   134
	s := tmpbuf.String()
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   135
	if strings.HasPrefix(s, "#") || strings.HasPrefix(s, "@") {
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   136
		b.WriteString(s) // Tag or mention: display content
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   137
		return
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   138
	}
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   139
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   140
	// Display href link
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   141
	for _, attr := range n.Attr {
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   142
		if attr.Key == "href" {
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   143
			link := n.Attr[0].Val
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   144
			b.WriteString(link)
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   145
			break
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   146
		}
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   147
	}
7d712d2bde73 Much improved html2text (fromhtml)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   148
}