Skip to content

Commit

Permalink
Fix markdown parser
Browse files Browse the repository at this point in the history
  • Loading branch information
manuel-serrano committed Nov 10, 2024
1 parent a082132 commit 564d2be
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 18 deletions.
38 changes: 25 additions & 13 deletions doc/doc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/* ------------------------------------------------------------- */
/* Author : Manuel Serrano */
/* Creation : Thu Jul 30 17:20:13 2015 */
/* Last change : Thu Aug 1 13:52:51 2024 (serrano) */
/* Last change : Sun Nov 10 18:12:33 2024 (serrano) */
/* Copyright : 2015-24 Manuel Serrano */
/* ------------------------------------------------------------- */
/* Tools to build the Hop.js documentation. */
Expand Down Expand Up @@ -306,9 +306,12 @@ function compileSection(page, target) {
</body>
</html>;

fs.writeFileSync(target || process.stdout,
hop.compileXML(document),
{ flush: true });
const xml = hop.compileXML(document);
if (target) {
fs.writeFileSync(target, xml, { flush: true });
} else {
fs.writeSync(process.stdout.fd, xml);
}
}

/*---------------------------------------------------------------------*/
Expand Down Expand Up @@ -368,9 +371,12 @@ function compileChapter(json, target) {
</body>
</html>;

fs.writeFileSync(target || process.stdout,
hop.compileXML(document),
{ flush: true });
const xml = hop.compileXML(document);
if (target) {
fs.writeFileSync(target, xml, { flush: true });
} else {
fs.writeFileSync(process.stdout.fd, xml);
}
}

/*---------------------------------------------------------------------*/
Expand Down Expand Up @@ -415,9 +421,12 @@ function compileMain(content, target) {
</body>
</html>;

fs.writeFileSync(target || process.stdout,
hop.compileXML(document),
{ flush: true });
const xml = hop.compileXML(document);
if (target) {
fs.writeFileSync(target, xml, { flush: true });
} else {
fs.writeFileSync(process.stdout.fd, xml);
}
}

/*---------------------------------------------------------------------*/
Expand Down Expand Up @@ -514,9 +523,12 @@ function compileIdx(json, target) {
</body>
</html>;

fs.writeFileSync(target || process.stdout,
hop.compileXML(document),
{ flush: true });
const xml = hop.compileXML(document);
if (target) {
fs.writeFileSync(target, xml, { flush: true });
} else {
fs.writeFileSync(process.stdout.fd, xml);
}
}

/*---------------------------------------------------------------------*/
Expand Down
2 changes: 1 addition & 1 deletion hopscript/array.scm
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@
(if (=fx i 0)
(cons (vector-ref vec i) acc)
(loop (-fx i 1) (cons (vector-ref vec i) acc))))))

(if (isa? ctx JsGlobalObject)
(with-access::JsArray obj (vec length)
(if (js-array-full-inlined? obj)
Expand Down
19 changes: 15 additions & 4 deletions node_modules/@hop/markdown/hop/_markdown.hop

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 564d2be

Please sign in to comment.