Announcement
Collapse
No announcement yet.
Markdown format
Collapse
X
-
Thanks for the follow-up. I am seeing that same behavior and found it's a limitation of our List support and how it parses the RegEx vs. the entire list. We'll open a tracker entry to investigate, but probably won't be a quick fix.
-
Hi, thanks for the reply.
Turns out it works using an element of "Basic" category, but the same expression doesn’t work as an element of the "List" category.
Here’s an example Test.bcpkg with two simple rules.
If you apply this to a simple text file:
Code:abcde bcdef
This is using 4.2.4 build 22795.
Leave a comment:
-
Hello,
Regular Expressions that begin with ^ can match on the start of the line, but can have issues if they are swallowed by a larger multi-line grammar. For example, I did get ^\s*\-\s+ working with " - abcdef" at the start of the line, but it only matches on " - ", and not the following abcdef
If you have specific grammars and example files or lines, you can post here or email [email protected] (with a new version of the .bcpkg and example files) including a link back to this forum thread for our reference.
Leave a comment:
-
Markdown format
Hi all,
I made a Markdown format: Markdown format.bcpkg.
It is somewhat quick and dirty but it gets the job done. Some of the rules are extensions used by mkdocs.
I noticed that a lot of regular expressions stop working if you anchor them to the beginning of a line. For example:
"!!!" will match "abc !!! def", but "^!!!" will not match "!!! abc". Similarly, "^\s*\-\s+" will not match " - abcdef".
I also tried parsing things like _italic_ and **bold**, but ran into the problem that a false positive may eat up the entire rest of the document. I’m not sure as to what rules markdown parsers actually use to consider an underscore to be the start or end of a span.
For people using this format: this defines a few new syntax highlighting elements, so go into tools › options › colors, fonts › file views, and set up the formatting (eg. change H1 to bold).
Cheers,
RoelandTags: None
Leave a comment: