find_div_pairs: Make paired labels for opening and closing div tags

View source: R/div.R

find_div_pairsR Documentation

Make paired labels for opening and closing div tags

Description

Make paired labels for opening and closing div tags

Usage

find_div_pairs(divs, close = div_close_regex())

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(), make_div_pairs(), 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)

carpentries/pegboard documentation built on Nov. 13, 2024, 8:53 a.m.