Skip to main content

wrap_table_html

Function wrap_table_html 

Source
pub fn wrap_table_html(tokens: &[String]) -> String
Expand description

Wraps table structure tokens with HTML document tags.

PP-StructureV3 outputs full HTML documents with <html><body><table>...</table></body></html>. This function wraps raw table tokens to match that format.

§Arguments

  • tokens - Table structure tokens (e.g., ["<tr>", "<td>", "...</td>", "</tr>"])

§Returns

Complete HTML string with document wrapper tags.

§Example

use oar_ocr_core::processors::wrap_table_html;

let tokens = vec!["<tr>".to_string(), "<td></td>".to_string(), "</tr>".to_string()];
let html = wrap_table_html(&tokens);
assert!(html.starts_with("<html><body><table>"));
assert!(html.ends_with("</table></body></html>"));