Skip to content

FIX: skip gated *-end nodes when the start is suppressed - #92

Open
BetterAndBetterII wants to merge 1 commit into
executablebooks:mainfrom
BetterAndBetterII:fix/gated-suppressed-end-nodes
Open

FIX: skip gated *-end nodes when the start is suppressed#92
BetterAndBetterII wants to merge 1 commit into
executablebooks:mainfrom
BetterAndBetterII:fix/gated-suppressed-end-nodes

Conversation

@BetterAndBetterII

Copy link
Copy Markdown

Start directives return [] when hide_solutions is set or the start has :hidden:. The matching solution-end / exercise-end still emits a marker node. Those nodes were registered with no writer visitors, so HTML (and LaTeX) raised NotImplementedError on the leftover.

Register SkipNode visitors for exercise_end_node and solution_end_node so unmatched gated end markers are not written. Covers all three crash modes from the issue:

  • hide_solutions with {solution-start}/{solution-end}
  • :hidden: on {solution-start}
  • :hidden: on {exercise-start}

Fixes #89

Start directives return [] for hide_solutions or :hidden:, leaving
unmatched *-end marker nodes in the doctree. Those nodes had no
writer visitors, so HTML raised NotImplementedError. Skip them.

Fixes executablebooks#89
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Gated directives crash the build when the start directive is suppressed (hide_solutions or :hidden:)

1 participant