1PFT::Text::Symbol(3)  User Contributed Perl Documentation PFT::Text::Symbol(3)
2
3
4

NAME

6       PFT::Text::Symbol - Symbol from text scan
7

SYNOPSIS

9           my $array = PFT::Text::Symbol->scan_html($your_html_text);
10           foreach (PFT::Text::Symbol->scan_html($your_html_text)) {
11               die unless $_->isa('PFT::Text::Symbol')
12           };
13

DESCRIPTION

15       Each instance of "PFT::Text::Symbol" represents a symbol obtained by
16       parsing the text of an entry "PFT::Content::Entry": they are detected
17       as "<a>" and "<img>" tags in HTML.  Symbols are collected into a a
18       "PFT::Text" object.
19
20       An example will make this easy to understand. Let's consider the
21       following tag:
22
23           <img src=":key1:a1/b1/c1">
24
25       It will generate a symbol $s1 such that:
26
27       "$s1->keyword" is "key1";
28       "$s1->args" is the list "(a1, b1, c1)";
29       "$s1->start" points to the first ":" character;
30       "$s1->len" points to the last 1 character;
31
32       Since a block of HTML can possibly yield multiple symbols, there's no
33       public construction. Use the "scan_html" multi-constructor instead.
34
35   Construction
36       Construction usually goes through "PFT::Text::Symbol->scan_html", which
37       expects an HTML string as parameter and returns a list of blessed
38       symbols.
39
40       For other needs (e.g. testing):
41
42           PFT::Text::Symbol->new($keyword, [$arg1, …, $argn], $start, $length)
43
44   Properties
45       keyword
46       args
47       start
48       len
49
50
51
52perl v5.30.0                      2019-07-23              PFT::Text::Symbol(3)
Impressum