Skip to main content

ALDashboard.validate_docx

CallAndDebugUndefined Objects

class CallAndDebugUndefined(DebugUndefined)

Handles Jinja2 undefined errors by printing the name of the undefined variable. Extended to handle callable methods.

__getitem__

type: ignore

get_jinja_errors

def get_jinja_errors(the_file: str) -> Optional[str]

Just try rendering the DOCX file as a Jinja2 template and catch any errors. Returns a string with the errors, if any.

detect_docx_automation_features

def detect_docx_automation_features(the_file: str) -> Dict[str, Any]

Detect non-plain-text DOCX constructs that often come from Word-centric automation systems.

strip_docx_problem_controls

def strip_docx_problem_controls(input_file: str,
output_file: str) -> Dict[str, Any]

Create a cleaned DOCX with risky SDTs and non-whitelisted simple fields removed.

Keeps page-number docpart SDTs and simple fields for page numbers/cross-references.