Skip to content
This repository was archived by the owner on Jun 7, 2023. It is now read-only.

Commit a1a07ac

Browse files
Allow block tags more than one char long
1 parent 857f69d commit a1a07ac

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

runestone/parsons/js/parsons.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,12 @@ export default class Parsons extends RunestoneBase {
309309
s.replace(/\s+/g, "")
310310
); // remove whitespace in tag and depends list
311311
tagIndex = textBlock.indexOf("#tag:");
312-
tag = textBlock.substring(tagIndex + 5, tagIndex + 6);
312+
tag = textBlock.substring(
313+
tagIndex + 5,
314+
textBlock.indexOf(";", tagIndex + 5)
315+
);
316+
if (tag == "")
317+
tag = "block-" + i;
313318
dependsIndex = textBlock.indexOf(";depends:");
314319
let dependsString = textBlock.substring(
315320
dependsIndex + 9,

0 commit comments

Comments
 (0)