Template:FAQItem: Difference between revisions

mNo edit summary
Tag: Reverted
mNo edit summary
Tag: Reverted
Line 44: Line 44:


<!-- Generate a stable anchor ID from the question text -->
<!-- Generate a stable anchor ID from the question text -->
<!-- Precompute everything BEFORE entering HTML mode -->
<!-- Anchor -->
{{#vardefine:frag|{{anchorencode:{{{question}}}}} }}
<span id="{{anchorencode:{{{question}}}}}"></span>
{{#vardefine:q|{{{question}}}}}
{{#vardefine:a|{{{answer}}}}}


<span id="{{#var:frag}}"></span>
<!-- FAQ block -->
 
<html>
<details class="faq-item">
<details class="faq-item">


<summary style="font-weight: bold; font-size:larger;">
<summary style="font-weight: bold; font-size:larger;">
{{#var:q}}
{{{question}}}
</summary>
</summary>


<div style="margin:0.5em 0 1em 0; font-size:smaller; opacity:0.7;">
<div style="margin:0.5em 0 1em 0; font-size:smaller; opacity:0.7;">
     <a href="#" class="copy-link" data-frag="{{#var:frag}}">
     <a href="#" class="copy-link" data-frag="{{anchorencode:{{{question}}}}}">
         Copy link to this question
         Copy link to this question
     </a>
     </a>
Line 65: Line 61:


<blockquote class="faq-answer">
<blockquote class="faq-answer">
{{#var:a}}
{{{answer}}}
</blockquote>
</blockquote>


</details>
</details>


<!-- Script (allowed in wikitext) -->
<script>
<script>
document.addEventListener('DOMContentLoaded', function() {
document.addEventListener('DOMContentLoaded', function() {
Line 87: Line 84:
});
});
</script>
</script>
</html>