<script src="https://cdn.jsdelivr.net/npm/@xiee/utils/js/faq.min.js" defer></script> <link href="https://cdn.jsdelivr.net/npm/@xiee/utils/css/faq.min.css" rel="stylesheet"></link>
See the full documentation at https://yihui.org/en/2018/11/md-js-tricks/.
title attribute to
<img> if the attribute does not exist. The value
of the attribute is taken from the
alt attribute. It modifies
<img src="foo.png" alt="an image" />
<img src="foo.png" alt="an image" title="an image" />
Then the image will have a tooltip on mouseover.
<object> on a page if they are the only child
of their parent element.
If a link of
<a> does not start with
https://, add the
<a> so it opens in a new tab/window.
Turn an ordered list on an HTML page into a collapsible FAQ list. Click on any
question to toggle the visibility of its answer. Or click on the button at the
top-right to expand or collapse all answers. Each FAQ item has an anchor (shown
# symbol at the end on mouseover) that provides the link to the
Note that you will need to load
faq.css accordingly. See a more detailed
Fix links to/from footnotes rendered by lower versions of Hugo (Blackfriday)
when footnotes do not contain any ASCII characters, in which case Hugo is unable
to render unique
ids for the footnote items (the
Fix the table of contents generated by lower versions of Hugo.
Convert HTML comments of the form
<!--# comments --> to
<span class="hash-note">comments</span>. If such comments are found, the
document body will gain classes
hide-notes. You can use CSS to
style the notes or hide/show them as you wish.
Add anchor links to all section headers (e.g.,
<h2>) that have nonempty
Write LaTeX math expressions (
<code></code in HTML or a pair of
backticks in Markdown (which will be rendered to
<code> in HTML), and this
script will remove the
<code> tag, so that MathJax can recognize the math
expressions (by default, MathJax ignores math in
nohighlight class to
<pre> when it does not have a
class, so that highlight.js will not try to syntax highlight the code in it.
<blockquote> footer if the footer is a
<p> that starts with