File tree Expand file tree Collapse file tree 2 files changed +14
-6
lines changed Expand file tree Collapse file tree 2 files changed +14
-6
lines changed Original file line number Diff line number Diff line change 39
39
def skip (self , node ):
40
40
raise docutils .nodes .SkipNode
41
41
42
+
42
43
# Used for nodes that should be gone by rendering time (OutputMimeBundleNode)
43
44
def halt (self , node ):
44
- raise ExtensionError ((f"Rendering encountered a node type that should "
45
- "have been removed before rendering: {type(node)}" ))
45
+ raise ExtensionError (
46
+ (
47
+ "Rendering encountered a node type that should "
48
+ "have been removed before rendering: %s" % type (node )
49
+ )
50
+ )
51
+
46
52
47
53
# Renders the children of a container
48
54
render_container = (
Original file line number Diff line number Diff line change @@ -442,22 +442,24 @@ def apply(self):
442
442
# Image collect extra nodes from cell outputs that we need to process
443
443
for node in self .document .traverse (image ):
444
444
# If the image node has `candidates` then it's already been processed
445
- # as in-line markdown , so skip it
445
+ # as in-line content , so skip it
446
446
if "candidates" in node :
447
447
continue
448
+ # re-initialize an ImageCollector because the `app` imagecollector instance
449
+ # is only available via event listeners.
448
450
col = ImageCollector ()
449
451
col .process_doc (self .app , node )
450
452
451
453
452
454
def _return_first_node_type (node , node_type ):
453
455
found_nodes = list (node .traverse (node_type ))
454
456
if len (found_nodes ) == 0 :
455
- raise ValueError (f "Found no nodes of type { node_type } in node { node } " )
457
+ raise ValueError ("Found no nodes of type %s in node %s" % ( node_type , node ) )
456
458
if len (found_nodes ) > 1 :
457
459
raise ValueError (
458
460
(
459
- f "Found more than one nodes of type { node_type } in node { node } . "
460
- "only return the first instance"
461
+ "Found more than one nodes of type %s in node %s. "
462
+ "only return the first instance" % ( node_type , node )
461
463
)
462
464
)
463
465
return found_nodes [0 ]
You can’t perform that action at this time.
0 commit comments