Closed anchpop closed 5 years ago
anchpop notifications@github.com writes:
Is there a function which can parse a String directly?
No, but there should be. This wouldn't be too hard to add. If you look at HXT, there's readFromString (or something) in addition to readDocument, so a few changes in Commonmark.Parser could do the trick.
I've added parseSyntaxDefinitionFromString
in master.
Try it out.
Thanks! Works perfectly. This made my day 😊
In my project, the definitions are embedded in the actual executable and are not present as external files. The only function I can find for creating a
Syntax
is parseSyntaxDefinition, which takes a filename and, from what I can tell, reads the file at that location and parses it. Is there a function which can parse a String directly?