askbot-dragon 1.7.72-beta → 1.7.73-beta

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "askbot-dragon",
3
- "version": "1.7.72-beta",
3
+ "version": "1.7.73-beta",
4
4
  "scripts": {
5
5
  "serve": "vue-cli-service serve",
6
6
  "build": "vue-cli-service build",
@@ -46,6 +46,7 @@ import ImgView from "./imgView";
46
46
  import hljs from 'highlight.js';
47
47
  import 'highlight.js/styles/default.css';
48
48
  const marked = require("marked")
49
+ import { v4 as uuidv4 } from "uuid";
49
50
  export default {
50
51
  name: "markDownText",
51
52
  data() {
@@ -530,9 +531,9 @@ export default {
530
531
  let codeList = doc.querySelectorAll('pre code')
531
532
  codeList.forEach(ele =>{
532
533
  let list = ele.getElementsByClassName("code_copy_btn")
533
- if(list.length == 0) {
534
+ if(list.length == 0 && ele.classList.indexOf("hljs") != "-1") {
534
535
  let text = ele.innerText
535
- let btnId = new Date().getTime()
536
+ let btnId = uuidv4();
536
537
  let copy = document.createElement('div')
537
538
  copy.classList.add("code_copy_btn")
538
539
  copy.setAttribute('id', btnId)