-
Notifications
You must be signed in to change notification settings - Fork 3
/
doctype.go
33 lines (27 loc) · 868 Bytes
/
doctype.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package lolhtml
/*
#include "lol_html.h"
*/
import "C"
// Doctype represents the document's doctype.
type Doctype C.lol_html_doctype_t
// DoctypeHandlerFunc is a callback handler function to do something with a Comment.
type DoctypeHandlerFunc func(*Doctype) RewriterDirective
// Name returns doctype name.
func (d *Doctype) Name() string {
nameC := (*str)(C.lol_html_doctype_name_get((*C.lol_html_doctype_t)(d)))
defer nameC.Free()
return nameC.String()
}
// PublicID returns doctype public ID.
func (d *Doctype) PublicID() string {
nameC := (*str)(C.lol_html_doctype_public_id_get((*C.lol_html_doctype_t)(d)))
defer nameC.Free()
return nameC.String()
}
// SystemID returns doctype system ID.
func (d *Doctype) SystemID() string {
nameC := (*str)(C.lol_html_doctype_system_id_get((*C.lol_html_doctype_t)(d)))
defer nameC.Free()
return nameC.String()
}