markdown-up 3.2.0 → 3.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/script.js +4 -1
  2. package/package.json +1 -1
package/lib/script.js CHANGED
@@ -274,7 +274,10 @@ export class MarkdownScriptRuntime {
274
274
  // Helper method to finish the current Markdown block and add its elements
275
275
  finishMarkdown() {
276
276
  if (this.markdown !== null) {
277
- const markdownOptions = {'headerIds': true, 'copyFn': this.options.copyFn, 'urlFn': this.options.urlFn};
277
+ const markdownOptions = {'headerIds': true, 'urlFn': this.options.urlFn};
278
+ if (this.options.window.navigator.clipboard) {
279
+ markdownOptions.copyFn = (text) => this.options.window.navigator.clipboard.writeText(text);
280
+ }
278
281
  try {
279
282
  this.addElements(markdownElements(parseMarkdown(this.markdown), markdownOptions));
280
283
  } catch {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "markdown-up",
4
- "version": "3.2.0",
4
+ "version": "3.2.1",
5
5
  "description": "MarkdownUp is a Markdown viewer",
6
6
  "keywords": [
7
7
  "markdown",