Make paired labels for opening and closing div tags
Arguments
- close
the regex for a valid closing tag
- nodes
a character vector of div open and close tags
Value
an integer vector with pairs of labels for each opening and closing tag. Note that the labels are produced by doing a cumulative sum of the node depths.
See also
Other div:
clean_div_tags()
,
find_between_tags()
,
get_divs()
,
label_div_tags()
,
label_pairs()
,
make_div_pairs()
,
make_div()
,
replace_with_div()
Examples
nodes <- c(
"<div class='1'>",
"<div class='2'>" ,
"</div>",
"<div class='2'>",
"<div class='3'>",
"</div>",
"</div>",
"</div>")
pegboard:::find_div_pairs(nodes)
#> [1] 1 2 2 3 4 4 3 1