Skip to content

Commit

Permalink
Added support for specifying copied text for code blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
squidfunk committed Oct 5, 2023
1 parent 57e598b commit 48ff39a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion material/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@
</script>
{% endblock %}
{% block scripts %}
<script src="{{ 'assets/javascripts/bundle.83df87ba.min.js' | url }}"></script>
<script src="{{ 'assets/javascripts/bundle.2a9e8380.min.js' | url }}"></script>
{% for script in config.extra_javascript %}
{{ script | script_tag }}
{% endfor %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ interface SetupOptions {
*/
function extract(el: HTMLElement): string {
el.setAttribute("data-md-copying", "")
const text = el.innerText
const text = el.getAttribute("data-clipboard-text") ?? el.innerText
el.removeAttribute("data-md-copying")
return text
}
Expand Down

0 comments on commit 48ff39a

Please sign in to comment.