marked-abc 0.1.1 → 0.1.3

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/lib/index.umd.js CHANGED
@@ -198,8 +198,9 @@ X:`),i=a.length;return i===0&&(i=1),i};var e=wt.TuneBook=function(n){var a=_2(n)
198
198
  `)+1).match(/^(\s+)/);if(n){let a=n[1];return e.replace(/\n/g,`
199
199
  ${a}`)}return e}var T5,qh,Dh=Yr(()=>{T5=Ih({}),qh=T5});var Rh={};Kh(Rh,{default:()=>B5});function E5(e){return e.replace(/[\x26\x0A\<>'"]/g,t=>"&#"+t.charCodeAt(0)+";")}function A5(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 M5(e,t){return e.split(`
200
200
  `).map(r=>t+r).join(`
201
- `)}function B5(e={}){return{extensions:[{name:"abcScore",level:"block",start(t){return Hh.exec(t)?.index},tokenizer(t){if(!zh.exec(t))return;let r=Oh.exec(t);if(r===null)return;let n=r.index+r[0].length,a=t.slice(0,n),i=a.replace(zh,"").replace(Oh,"");return{type:"abcScore",raw:a,abc:i}},renderer(t){let r=`abc-score-${++_5}`,n=e.sanitizer??E5;return"document"in globalThis&&A5(`#${r}`).then(a=>{Fh.renderAbc(a,t.abc.split(`
202
- `).map(i=>i.trim()).join(),e.abcOptions)}),qh`<div class="abc-score" id="${r}">
201
+ `)}function B5(e={}){return{extensions:[{name:"abcScore",level:"block",start(t){return Hh.exec(t)?.index},tokenizer(t){if(!zh.exec(t))return;let r=Oh.exec(t);if(r===null)return;let n=r.index+r[0].length,a=t.slice(0,n),i=a.replace(zh,"").replace(Oh,"").trim().split(`
202
+ `).map(s=>s.trim()).join(`
203
+ `);return console.log(i),{type:"abcScore",raw:a,abc:i}},renderer(t){let r=`abc-score-${++_5}`,n=e.sanitizer??E5;return"document"in globalThis&&A5(`#${r}`).then(a=>{Fh.renderAbc(a,t.abc,e.abcOptions)}),qh`<div class="abc-score" id="${r}">
203
204
  ${M5(n(t.abc)," ")}
204
205
  </div>
205
206
  `}}]}}var Fh,_5,Hh,zh,Oh,Gh=Yr(()=>{"use strict";$n();Fh=Qh(Nh(),1);Dh();_5=0;Hh=/<score\s+lang="(ABC|abc)"\s*>/,zh=new RegExp("^"+Hh.source),Oh=/<\/score>/});module.exports=(Gh(),Zh(Rh)).default;