Skip to content

Commit

Permalink
Executando os superfaces de quiz só nas páginas de quiz
Browse files Browse the repository at this point in the history
  • Loading branch information
dunossauro committed Jun 9, 2024
1 parent cbe98df commit ac46087
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions hooks/quiz_hook.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,19 @@ def format_quiz(source, *args, **kwargs):


def on_page_markdown(markdown_text, *args, **kwargs):
md = markdown.markdown(
markdown_text,
extensions=['pymdownx.superfences'],
extension_configs={
'pymdownx.superfences': {
'custom_fences': [
{'name': 'quiz', 'class': 'quiz', 'format': format_quiz}
]
}
},
)
return md
if '```quiz' in markdown_text:
md = markdown.markdown(
markdown_text,
extensions=['pymdownx.superfences'],
extension_configs={
'pymdownx.superfences': {
'custom_fences': [
{'name': 'quiz', 'class': 'quiz', 'format': format_quiz}
]
}
},
)
return md


def on_page_content(html, *args, **kwargs):
Expand Down

0 comments on commit ac46087

Please sign in to comment.