No announcement yet.

Markdown format

  • Filter
  • Time
  • Show
Clear All
new posts

  • 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).


  • #2

    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.
    Aaron P Scooter Software


    • #3
      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:

      You will see that the "^a\w+" expression doesn’t match anything while the "^b\w+" matches the second line. This is a bit surprising but easy to work around.

      This is using 4.2.4 build 22795.


      • #4
        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.
        Aaron P Scooter Software