<commit_before>name: 'Markdown'
scopeName: 'text.md'
fileTypes: [
  'emdee' # temporary file-type, to co-exist with other packages
  # 'markdown'
  # 'md'
  # 'mdown'
  # 'mkd'
  # 'mkdown'
  # 'rmd'
  # 'ron'
]

maxTokensPerLine: 100

patterns: [
  { include: '#blocks' }
  { include: '#inlines' }
]

repository:
  blocks:
    patterns: [
      { include: '#comments' }
      { include: '#hr' }
      { include: '#headings' }
      { include: '#lists' }
      { include: '#quotes' }
      { include: '#tables' }
      { include: 'fenced-code.md' }
    ]
  inlines:
    patterns: [
      { include: '#escapes' }
      { include: '#code' }
      { include: '#entities' }
      { include: '#links' }
      { include: '#html' }
      { include: '#emphasis' }
      { include: '#github' }
      { include: '#criticmark' }
    ]

  #
  # inline
  # CODE
  #

  code:
    patterns: [
      {
        # begin: '(`+)(?!$)'
        # end: '(?<!`)(\\1)(?!`)'
        # match: '(?<!`)(`+)[^`]+(\\1)(?!`)'
        match: '(?<!`)(`{1,2})(?!`).+?(?<!`)(\\1)(?!`)'
        name: 'code.raw.markup.md'
        captures:
          1: name: 'punctuation.md'
          2: name: 'punctuation.md'
      }
    ]

  #
  # inline
  # COMMENTS
  #

  comments:
    patterns: [
      {
        name: 'comment.md'
        begin: '(<!--)'
        end: '(-->)'
        captures:
          1: name: 'punctuation.md'
          3: name: 'punctuation.md'
      }
    ]

  #
  # inline
  # CRITICMARK
  #

  criticmark:
    patterns: [
      {
        name: 'addition.critic.inserted.markup.md'
        begin: '({\\+\\+)'
        beginCaptures:
          1: name: 'punctuation.md'
        end: '(\\+\\+})'
        endCaptures:
          1: name: 'punctuation.md'
        patterns: [
          { include: '#emphasis' }
        ]
      }
      {
        name: 'deletion.critic.deleted.markup.md'
        begin: '({--)'
        beginCaptures:
          1: name: 'punctuation.md'
        end: '(--})'
        endCaptures:
          1: name: 'punctuation.md'
        patterns: [
          { include: '#emphasis' }
        ]
      }
      {
        name: 'highlight.critic.changed.markup.md'
        begin: '({==)'
        beginCaptures:
          1: name: 'punctuation.md'
        end: '(==})'
        endCaptures:
          1: name: 'punctuation.md'
        patterns: [
          { include: '#emphasis' }
        ]
      }
      {
        name: 'comment.critic.markup.md'
        begin: '({>>)'
        beginCaptures:
          1: name: 'punctuation.md'
        patterns: [
          {
            match: '(?<=[\\s|>])((@)(\\w[-\\w:]*))(?=\\s)'
            captures:
              1: name: 'username.reference.md'
              2: name: 'punctuation.md'
          }
          { include: '#emphasis' }
        ]
        end: '(<<})'
        endCaptures:
          1: name: 'punctuation.md'
      }
      {
        name: 'substitution.critic.inserted.markup.md'
        begin: '({~~)'
        beginCaptures:
          1: name: 'punctuation.md'
        end: '(~~})'
        endCaptures:
          1: name: 'punctuation.md'
        patterns: [
          {
            match: '~>'
            name: 'punctuation.md'
          }
          { include: '#emphasis' }
        ]
      }
    ]

  #
  # inline
  # EMPHASIS
  #<commit_msg>Update scope for reference in criticmark<commit_after>name: 'Markdown'
scopeName: 'text.md'
fileTypes: [
  'emdee' # temporary file-type, to co-exist with other packages
  # 'markdown'
  # 'md'
  # 'mdown'
  # 'mkd'
  # 'mkdown'
  # 'rmd'
  # 'ron'
]

maxTokensPerLine: 100

patterns: [
  { include: '#blocks' }
  { include: '#inlines' }
]

repository:
  blocks:
    patterns: [
      { include: '#comments' }
      { include: '#hr' }
      { include: '#headings' }
      { include: '#lists' }
      { include: '#quotes' }
      { include: '#tables' }
      { include: 'fenced-code.md' }
    ]
  inlines:
    patterns: [
      { include: '#escapes' }
      { include: '#code' }
      { include: '#entities' }
      { include: '#links' }
      { include: '#html' }
      { include: '#emphasis' }
      { include: '#github' }
      { include: '#criticmark' }
    ]

  #
  # inline
  # CODE
  #

  code:
    patterns: [
      {
        # begin: '(`+)(?!$)'
        # end: '(?<!`)(\\1)(?!`)'
        # match: '(?<!`)(`+)[^`]+(\\1)(?!`)'
        match: '(?<!`)(`{1,2})(?!`).+?(?<!`)(\\1)(?!`)'
        name: 'code.raw.markup.md'
        captures:
          1: name: 'punctuation.md'
          2: name: 'punctuation.md'
      }
    ]

  #
  # inline
  # COMMENTS
  #

  comments:
    patterns: [
      {
        name: 'comment.md'
        begin: '(<!--)'
        end: '(-->)'
        captures:
          1: name: 'punctuation.md'
          3: name: 'punctuation.md'
      }
    ]

  #
  # inline
  # CRITICMARK
  #

  criticmark:
    patterns: [
      {
        name: 'addition.critic.inserted.markup.md'
        begin: '({\\+\\+)'
        beginCaptures:
          1: name: 'punctuation.md'
        end: '(\\+\\+})'
        endCaptures:
          1: name: 'punctuation.md'
        patterns: [
          { include: '#emphasis' }
        ]
      }
      {
        name: 'deletion.critic.deleted.markup.md'
        begin: '({--)'
        beginCaptures:
          1: name: 'punctuation.md'
        end: '(--})'
        endCaptures:
          1: name: 'punctuation.md'
        patterns: [
          { include: '#emphasis' }
        ]
      }
      {
        name: 'highlight.critic.changed.markup.md'
        begin: '({==)'
        beginCaptures:
          1: name: 'punctuation.md'
        end: '(==})'
        endCaptures:
          1: name: 'punctuation.md'
        patterns: [
          { include: '#emphasis' }
        ]
      }
      {
        name: 'comment.critic.markup.md'
        begin: '({>>)'
        beginCaptures:
          1: name: 'punctuation.md'
        patterns: [
          {
            match: '(?<=[\\s|>])((@)(\\w[-\\w:]*))(?=\\s)'
            captures:
              1: name: 'username.reference.variable.md'
              2: name: 'punctuation.md'
          }
          { include: '#emphasis' }
        ]
        end: '(<<})'
        endCaptures:
          1: name: 'punctuation.md'
      }
      {
        name: 'substitution.critic.inserted.markup.md'
        begin: '({~~)'
        beginCaptures:
          1: name: 'punctuation.md'
        end: '(~~})'
        endCaptures:
          1: name: 'punctuation.md'
        patterns: [
          {
            match: '~>'
            name: 'punctuation.md'
          }
          { include: '#emphasis' }
        ]
      }
    ]

  #
  # inline
  # EMPHASIS
  #
{'fraction_non_alphanumeric': 0.19167927382753405, 'fraction_numerical': 0.007261724659606656, 'mean_word_length': 1.449425713227121, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5683154', 'n_tokens_mistral': 2421, 'n_tokens_neox': 2374, 'n_words': 385}