@@ -97,6 +97,7 @@ def __init__(
9797 exclude_source_paths : List [str ],
9898 test_report_root_dict : Dict [str , str ],
9999 source_nodes : List [Dict [str , str ]],
100+ html2pdf_strict : bool ,
100101 html2pdf_template : Optional [str ],
101102 bundle_document_version : Optional [str ],
102103 bundle_document_date : Optional [str ],
@@ -172,6 +173,7 @@ def __init__(
172173
173174 self .excel_export_fields : Optional [List [str ]] = None
174175
176+ self .html2pdf_strict : bool = html2pdf_strict
175177 self .html2pdf_template : Optional [str ] = html2pdf_template
176178 self .bundle_document_version : Optional [str ] = bundle_document_version
177179 self .bundle_document_date : Optional [str ] = bundle_document_date
@@ -226,6 +228,7 @@ def default_config(environment: SDocRuntimeEnvironment) -> "ProjectConfig":
226228 exclude_source_paths = [],
227229 test_report_root_dict = {},
228230 source_nodes = [],
231+ html2pdf_strict = False ,
229232 html2pdf_template = None ,
230233 bundle_document_version = ProjectConfig .DEFAULT_BUNDLE_DOCUMENT_VERSION ,
231234 bundle_document_date = ProjectConfig .DEFAULT_BUNDLE_DOCUMENT_COMMIT_DATE ,
@@ -505,6 +508,7 @@ def _load_from_dictionary(
505508 exclude_source_paths : List [str ] = []
506509 test_report_root_dict : Dict [str , str ] = {}
507510 source_nodes : List [Dict [str , str ]] = []
511+ html2pdf_strict : bool = False
508512 html2pdf_template : Optional [str ] = None
509513 bundle_document_version = ProjectConfig .DEFAULT_BUNDLE_DOCUMENT_VERSION
510514 bundle_document_date = ProjectConfig .DEFAULT_BUNDLE_DOCUMENT_COMMIT_DATE
@@ -626,6 +630,16 @@ def _load_from_dictionary(
626630 f"{ exception_ } Provided string: '{ exclude_source_path } '."
627631 ) from exception_
628632
633+ html2pdf_strict = project_content .get (
634+ "html2pdf_strict" , html2pdf_strict
635+ )
636+ if html2pdf_strict is not None :
637+ if not isinstance (html2pdf_strict , bool ):
638+ raise ValueError (
639+ "strictdoc.toml: 'html2pdf_strict': "
640+ f"must be a true/false value: { html2pdf_strict } ."
641+ )
642+
629643 html2pdf_template = project_content .get (
630644 "html2pdf_template" , html2pdf_template
631645 )
@@ -757,6 +771,7 @@ def _load_from_dictionary(
757771 exclude_source_paths = exclude_source_paths ,
758772 test_report_root_dict = test_report_root_dict ,
759773 source_nodes = source_nodes ,
774+ html2pdf_strict = html2pdf_strict ,
760775 html2pdf_template = html2pdf_template ,
761776 bundle_document_version = bundle_document_version ,
762777 bundle_document_date = bundle_document_date ,
0 commit comments