marked-abc 0.1.2 → 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.esm.js +3 -2
- package/lib/index.esm.js.map +2 -2
- package/lib/index.umd.js +3 -2
- package/lib/index.umd.js.map +2 -2
- package/package.json +1 -1
- package/src/index.ts +9 -2
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -93,7 +93,14 @@ export default function(options: MarkedAbcOptions = {}): MarkedExtension {
|
|
|
93
93
|
}
|
|
94
94
|
const end = endMatch.index + endMatch[0].length;
|
|
95
95
|
const raw = src.slice(0, end);
|
|
96
|
-
const abc = raw
|
|
96
|
+
const abc = raw
|
|
97
|
+
.replace(SCORE_OPEN_BEGIN, '')
|
|
98
|
+
.replace(SCORE_CLOSE, '')
|
|
99
|
+
.trim()
|
|
100
|
+
.split('\n')
|
|
101
|
+
.map((line) => line.trim())
|
|
102
|
+
.join('\n');
|
|
103
|
+
console.log(abc);
|
|
97
104
|
return {
|
|
98
105
|
type: 'abcScore',
|
|
99
106
|
raw,
|
|
@@ -115,7 +122,7 @@ export default function(options: MarkedAbcOptions = {}): MarkedExtension {
|
|
|
115
122
|
abcjs.renderAbc(
|
|
116
123
|
ele,
|
|
117
124
|
// Trim all leading whitespace or ABCjs freaks out and fails to render it all
|
|
118
|
-
(token as AbcToken).abc
|
|
125
|
+
(token as AbcToken).abc,
|
|
119
126
|
options.abcOptions,
|
|
120
127
|
);
|
|
121
128
|
});
|