Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Haskell support #123

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ Note that in order for a language to be highlighted properly, you must have the
* `go`
* `lodash`
* `handlebars|hbs`: requires the Sublime Text [Handlebars](https://github.com/daaain/Handlebars) package
* `haskell`
* `html|html5`
* `ini`
* `jade`
Expand Down
21 changes: 21 additions & 0 deletions Syntaxes/Markdown Extended.JSON-tmLanguage
Original file line number Diff line number Diff line change
Expand Up @@ -863,6 +863,27 @@
}
}
},
{
"name": "markup.raw.block.markdown markup.raw.block.fenced.markdown",
"end": "(```|~~~|{%\\s*endhighlight\\s*%})\\n",
"begin": "(```|~~~|{%\\s*highlight)\\s*(haskell)\\s*((?:linenos\\s*)?%})?$",
"patterns": [
{
"include": "source.haskell"
}
],
"captures": {
"1": {
"name": "punctuation.definition.fenced.markdown"
},
"2": {
"name": "variable.language.fenced.markdown"
},
"3": {
"name": "punctuation.definition.fenced.markdown"
}
}
},
{
"name": "markup.raw.block.markdown markup.raw.block.fenced.markdown",
"end": "(```|~~~|{%\\s*endhighlight\\s*%})\\n",
Expand Down
15 changes: 15 additions & 0 deletions Syntaxes/Markdown Extended.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,21 @@ contexts:
3: punctuation.definition.fenced.markdown
pop: true
- include: scope:source.erlang
- match: '(```|~~~|{%\s*highlight)\s*(haskell)\s*((?:linenos\s*)?%})?$'
captures:
1: punctuation.definition.fenced.markdown
2: variable.language.fenced.markdown
3: punctuation.definition.fenced.markdown
push:
- meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown
- meta_content_scope: source.haskell
- match: '(```|~~~|{%\s*endhighlight\s*%})\n'
captures:
1: punctuation.definition.fenced.markdown
2: variable.language.fenced.markdown
3: punctuation.definition.fenced.markdown
pop: true
- include: scope:source.haskell
- match: '(```|~~~|{%\s*highlight)\s*(diff)\s*((?:linenos\s*)?%})?$'
captures:
1: punctuation.definition.fenced.markdown
Expand Down
35 changes: 34 additions & 1 deletion Syntaxes/Markdown Extended.tmLanguage
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<!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>
Expand Down Expand Up @@ -380,6 +380,39 @@
</dict>
</array>
</dict>
<dict>
<key>begin</key>
<string>(```|~~~|{%\s*highlight)\s*(haskell)\s*((?:linenos\s*)?%})?$</string>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.fenced.markdown</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>variable.language.fenced.markdown</string>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>punctuation.definition.fenced.markdown</string>
</dict>
</dict>
<key>end</key>
<string>(```|~~~|{%\s*endhighlight\s*%})\n</string>
<key>name</key>
<string>markup.raw.block.markdown markup.raw.block.fenced.markdown</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>source.haskell</string>
</dict>
</array>
</dict>
<dict>
<key>begin</key>
<string>(```|~~~|{%\s*highlight)\s*(diff)\s*((?:linenos\s*)?%})?$</string>
Expand Down