UNPKG

secst

Version:

SECST is a semantic, extensible, computational, styleable tagged markup language. You can use it to joyfully create compelling, interactive documents backed by HTML.

12 lines (11 loc) 297 B
const extractValue = (el) => { const extract = el.getAttribute("data-extract"); if(extract) { const match = [...el.value.matchAll(new RegExp(extract,"g"))][0]; if(match) { return match[1]; } } return el.value; } export {extractValue}