Autoscoping (#103)
* Add autoscoping with generated demo * Remove manual demo from all snippets * Add JavaScript inside IIFE * Align mouse-cursor-gradient-tracking.md to demo code * Match snippets to demo * Update CONTRIBUTING.md * Create reusable function for code extraction
This commit is contained in:
@ -18,3 +18,6 @@ exports.createElement = str => {
|
||||
el.innerHTML = str
|
||||
return el.firstElementChild
|
||||
}
|
||||
|
||||
exports.getCode = (type, str) =>
|
||||
(str.match(new RegExp('```' + type + '([\\s\\S]*?)```')) || [])[1] || ''
|
||||
|
||||
Reference in New Issue
Block a user