#pragma once

#include <string>
#include <vector>
#include <tuple>
#include <regex>
#include "character.h"


using numbered_element_spec = std::tuple<std::string, std::string, std::string>;
//using numbered_elements = std::vector<std::vector<numbered_element_spec>>;
using numbered_elements = std::vector<numbered_element_spec>;

numbered_elements html_line_states(const std::vector<std::string>& lines);
numbered_elements latex_line_states(const std::vector<std::string>& lines);

std::pair<std::string, int> add_html_caption_numbers(const std::string& html_text, int& chapter_number);
std::string add_latex_caption_numbers(const std::string& text);

std::string resolve_caption_references(
    const std::string& target, const std::vector<std::string>& lines, numbered_elements states);

