BuptStEve / vuepress-plugin-demo-code

📝 Demo and code plugin for vuepress
https://buptsteve.github.io/vuepress-plugin-demo-code/
MIT License
125 stars 28 forks source link

feat: Performance Issue #16

Closed tianjianchn closed 4 years ago

tianjianchn commented 4 years ago

Is your feature request related to a problem? Please describe. With a long demo code, after highlighted and insert into markdown render, Vue takes such a long time to render(+10s).

Describe the solution you'd like https://github.com/BuptStEve/vuepress-plugin-demo-code/blob/ee0b88322a4e498d173bb3f894dfd3e4d692b831/src/index.js#L93-L95

instead of inserting the highlighted html into the markdown, use v-html to render it at runtime in DemoAndCode.vue

Describe alternatives you've considered None.

Additional context Add any other context or screenshots about the feature request here. None.

BuptStEve commented 4 years ago

Bravo!
It's about 15947 ms VS 1212 ms(1000 lines)

BuptStEve commented 4 years ago

@all-contributors add @tianjianchn for bug

allcontributors[bot] commented 4 years ago

@BuptStEve

I've put up a pull request to add @tianjianchn! :tada: