mirror of
https://github.com/vlang/v.git
synced 2025-09-15 07:22:27 +03:00
net.html: add note to parse and parse_file, that they will produce a DOM with lowercased tag names (#19720)
This commit is contained in:
parent
adb46ff645
commit
cee947ca9e
1 changed files with 4 additions and 0 deletions
|
@ -3,6 +3,8 @@ module html
|
|||
import os
|
||||
|
||||
// parse parses and returns the DOM from the given text.
|
||||
// Note: this function will parse all tags to lowercase.
|
||||
// E.g. <MyTag>content<MyTag/> is converted to <mytag>content<mytag>
|
||||
pub fn parse(text string) DocumentObjectModel {
|
||||
mut parser := Parser{}
|
||||
parser.parse_html(text)
|
||||
|
@ -10,6 +12,8 @@ pub fn parse(text string) DocumentObjectModel {
|
|||
}
|
||||
|
||||
// parse_file parses and returns the DOM from the contents of a file.
|
||||
// Note: this function will parse all tags to lowercase.
|
||||
// E.g. <MyTag>content<MyTag/> is converted to <mytag>content<mytag>
|
||||
pub fn parse_file(filename string) DocumentObjectModel {
|
||||
content := os.read_file(filename) or { return DocumentObjectModel{
|
||||
root: &Tag{}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue