marked-abc 0.0.0 → 0.1.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.
- package/README.md +2 -1
- package/lib/index.esm.js +2 -1
- package/lib/index.esm.js.map +2 -2
- package/lib/index.umd.js +2 -1
- package/lib/index.umd.js.map +2 -2
- package/package.json +2 -2
- package/src/index.ts +16 -4
package/README.md
CHANGED
package/lib/index.esm.js
CHANGED
|
@@ -197,7 +197,8 @@ Please report this to https://github.com/markedjs/marked.`,e){let n="<p>An error
|
|
|
197
197
|
`)+1).match(/^(\s+)/);if(n){let a=n[1];return e.replace(/\n/g,`
|
|
198
198
|
${a}`)}return e}var y5=0;function w5(e){return e.replace(/[\x26\x0A\<>'"]/g,t=>"&#"+t.charCodeAt(0)+";")}function x5(e){return new Promise(t=>{let r=document.querySelector(e);if(r)return t(r);let n=new MutationObserver(a=>{let i=document.querySelector(e);i&&(n.disconnect(),t(i))});n.observe(document.body,{childList:!0,subtree:!0})})}function k5(e,t){return e.split(`
|
|
199
199
|
`).map(r=>t+r).join(`
|
|
200
|
-
`)}var Dh=/<score\s+lang="(ABC|abc)"\s*>/,Lh=new RegExp("^"+Dh.source),qh=/<\/score>/;function Mm(e={}){return{extensions:[{name:"abcScore",level:"block",start(t){return Dh.exec(t)?.index},tokenizer(t){if(!Lh.exec(t))return;let r=qh.exec(t);if(r===null)
|
|
200
|
+
`)}var Dh=/<score\s+lang="(ABC|abc)"\s*>/,Lh=new RegExp("^"+Dh.source),qh=/<\/score>/;function Mm(e={}){return{extensions:[{name:"abcScore",level:"block",start(t){return Dh.exec(t)?.index},tokenizer(t){if(!Lh.exec(t))return;let r=qh.exec(t);if(r===null)return;let n=r.index+r[0].length,a=t.slice(0,n),i=a.replace(Lh,"").replace(qh,"");return{type:"abcScore",raw:a,abc:i}},renderer(t){let r=`abc-score-${++y5}`,n=e.sanitizer??w5;return"document"in globalThis&&x5(`#${r}`).then(a=>{Ih.renderAbc(a,t.abc.split(`
|
|
201
|
+
`).map(i=>i.trim()).join(),e.abcOptions)}),Nh`<div class="abc-score" id="${r}">
|
|
201
202
|
${k5(n(t.abc)," ")}
|
|
202
203
|
</div>
|
|
203
204
|
`}}]}}export{Mm as default};
|