Browse Source

showhide buttons?

pull/73/head
adam j hartz 1 month ago
parent
commit
722593704e
Signed by: hz <hartz@mit.edu> GPG Key ID: 5FDD2840E179AD62
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      catsoop/language.py

+ 1
- 1
catsoop/language.py View File

@@ -797,7 +797,7 @@ def handle_custom_tags(context, text):
# hints (<showhide>)
def _showhide_replacer(match):
body = source_transform_string(context, match.groupdict()["body"])
out = """<div class="response"><button class="btn-catsoop" onclick="if(this.parentElement.children[1].style.display === 'none'){this.parentElement.children[1].style.display = 'block';}else{this.parentElement.children[1].style.display = 'none';}">Show/Hide</button>\n"""
out = """<div class="response"><button class="btn btn-catsoop" onclick="if(this.parentElement.children[1].style.display === 'none'){this.parentElement.children[1].style.display = 'block';}else{this.parentElement.children[1].style.display = 'none';}">Show/Hide</button>\n"""
out += '<div style="display:none;">%s</div>' % (body,)
return out + "</div>"



Loading…
Cancel
Save