mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2025-01-31 11:53:53 +01:00
Added support for specifying copied text for code blocks
This commit is contained in:
parent
57e598b96e
commit
48ff39a5cc
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -249,7 +249,7 @@
|
|||||||
</script>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block scripts %}
|
{% 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 %}
|
{% for script in config.extra_javascript %}
|
||||||
{{ script | script_tag }}
|
{{ script | script_tag }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
@ -55,7 +55,7 @@ interface SetupOptions {
|
|||||||
*/
|
*/
|
||||||
function extract(el: HTMLElement): string {
|
function extract(el: HTMLElement): string {
|
||||||
el.setAttribute("data-md-copying", "")
|
el.setAttribute("data-md-copying", "")
|
||||||
const text = el.innerText
|
const text = el.getAttribute("data-clipboard-text") ?? el.innerText
|
||||||
el.removeAttribute("data-md-copying")
|
el.removeAttribute("data-md-copying")
|
||||||
return text
|
return text
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user