From 8dac97afa73d59e6afcad04ca076355576b6eb51 Mon Sep 17 00:00:00 2001 From: Yuvi Panda Date: Fri, 1 Mar 2024 02:42:36 -0800 Subject: [PATCH] [HTMLExporter] Initialize resources before widget filtering (#2118) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- CHANGELOG.md | 1 + nbconvert/exporters/html.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2cccc3286..8a50a7dca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1536,6 +1536,7 @@ raw template {%- endblock in_prompt -%} """ + exporter_attr = AttrExporter() output_attr, _ = exporter_attr.from_notebook_node(nb) assert "raw template" in output_attr diff --git a/nbconvert/exporters/html.py b/nbconvert/exporters/html.py index 00b86e1f0..d63699c0d 100644 --- a/nbconvert/exporters/html.py +++ b/nbconvert/exporters/html.py @@ -257,6 +257,8 @@ def from_notebook_node( # type:ignore[explicit-override, override] "highlight_code", Highlight2HTML(pygments_lexer=lexer, parent=self) ) + resources = self._init_resources(resources) + filter_data_type = WidgetsDataTypeFilter( notebook_metadata=self._nb_metadata, parent=self, resources=resources )