Skip to content

Commit

Permalink
Markdown: Support frontmatter and fenced code blocks.
Browse files Browse the repository at this point in the history
First try, still quite buggy ...
  • Loading branch information
noniq committed Aug 27, 2015
1 parent d575ac9 commit 9fbc9fa
Show file tree
Hide file tree
Showing 2 changed files with 107 additions and 0 deletions.
29 changes: 29 additions & 0 deletions Markdown.tmbundle/Syntaxes/Fenced Code Blocks.tmLanguage
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>fileTypes</key>
<array/>
<key>injectionSelector</key>
<string>L:text.html.markdown</string>
<key>name</key>
<string>Markdown Fenced Code Blocks</string>
<key>patterns</key>
<array>
<dict>
<key>begin</key>
<string>^``` *(\w+) *$</string>
<key>contentName</key>
<string>meta.embedded_$1.markdown</string>
<key>end</key>
<string>^``` *\n?</string>
<key>name</key>
<string>markup.raw.block.markdown</string>
</dict>
</array>
<key>scopeName</key>
<string>injection.markdown.highlight</string>
<key>uuid</key>
<string>8D30AC8B-2D2B-4BCE-9200-E96191422139</string>
</dict>
</plist>
78 changes: 78 additions & 0 deletions Markdown.tmbundle/Syntaxes/Markdown.tmLanguage
@@ -0,0 +1,78 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>changed</key>
<dict>
<key>repository.block.patterns</key>
<array>
<dict>
<key>include</key>
<string>#frontmatter</string>
</dict>
<dict>
<key>include</key>
<string>#separator</string>
</dict>
<dict>
<key>include</key>
<string>#heading</string>
</dict>
<dict>
<key>include</key>
<string>#blockquote</string>
</dict>
<dict>
<key>include</key>
<string>#lists</string>
</dict>
<dict>
<key>include</key>
<string>#raw_block</string>
</dict>
<dict>
<key>include</key>
<string>#link-def</string>
</dict>
<dict>
<key>include</key>
<string>#html</string>
</dict>
<dict>
<key>include</key>
<string>#paragraph</string>
</dict>
</array>
<key>repository.block.repository.frontmatter</key>
<dict>
<key>begin</key>
<string>(?:^|\G)---\s*\n</string>
<key>end</key>
<string>(?:^|\G)---\s*\n</string>
<key>name</key>
<string>markup.raw.block.frontmatter.markdown</string>
<key>patterns</key>
<array>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>entity.name.tag.frontmatter</string>
</dict>
</dict>
<key>match</key>
<string>(?:^|\G)(\w+:).*$</string>
<key>name</key>
<string>string.unquoted.frontmatter</string>
</dict>
</array>
</dict>
</dict>
<key>isDelta</key>
<true/>
<key>uuid</key>
<string>0A1D9874-B448-11D9-BD50-000D93B6E43C</string>
</dict>
</plist>

0 comments on commit 9fbc9fa

Please sign in to comment.