-
Notifications
You must be signed in to change notification settings - Fork 82
Go Language Syntax Support #53
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
Closed
Closed
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
2c95d2f
Add missing css keywords / values
Manoz ff55df1
Add ALL css properties (css1, css2 and css3)
Manoz a1a0626
Less keywords per line
Manoz 102ecac
Inital support Go language syntax
LoveMHz 77147c8
Update syntaxhighlighter.php
LoveMHz 383faf4
update shBrushCpp.js.
wevsty 2fac673
support cpp special character
wevsty e661491
Tighten auto-link regex so it only links https? links.
donnchawp f87f812
Merge pull request #2 from wevsty/master
donnchawp ba1379c
Merge pull request #1 from Automattic/fix/url_regex
donnchawp 988ecc0
Merge pull request #6 from Manoz/master
donnchawp d71745c
Update docs, changelog, version to 3.5.1
donnchawp 94a70f0
Merge pull request #7 from Automattic/release_3_5_1
donnchawp 48e3993
Merge branch 'master' into feature_golang_syntax
LoveMHz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| /** | ||
| * SyntaxHighlighter | ||
| * http://alexgorbatchev.com/SyntaxHighlighter | ||
| * | ||
| * SyntaxHighlighter is donationware. If you are using it, please donate. | ||
| * http://alexgorbatchev.com/SyntaxHighlighter/donate.html | ||
| * | ||
| * @version | ||
| * 3.0.83 (Wed, 16 Apr 2014 03:56:09 GMT) | ||
| * | ||
| * @copyright | ||
| * Copyright (C) 2004-2013 Alex Gorbatchev. | ||
| * | ||
| * @license | ||
| * Dual licensed under the MIT and GPL licenses. | ||
| */ | ||
| ;(function() | ||
| { | ||
| // CommonJS | ||
| SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? require('shCore').SyntaxHighlighter : null); | ||
|
|
||
| function Brush() | ||
| { | ||
| var keywords = 'break default func interface select case defer go map struct ' + | ||
| 'chan else goto package switch const fallthrough if range type' + | ||
| 'continue for import return var uint8 uint16 uint32 uint64 int8 ' + | ||
| 'int16 int32 int64 float32 float64 complex64 complex128 byte rune ' + | ||
| 'string'; | ||
|
|
||
| this.regexList = [ | ||
| { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments | ||
| { regex: /\/\*([^\*][\s\S]*?)?\*\//gm, css: 'comments' }, // multiline comments | ||
| { regex: /\/\*(?!\*\/)\*[\s\S]*?\*\//gm, css: 'preprocessor' }, // documentation comments | ||
| { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings | ||
| { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings | ||
| { regex: /\b([\d]+(\.[\d]+)?|0x[a-f0-9]+)\b/gi, css: 'value' }, // numbers | ||
| { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // java keyword | ||
| ]; | ||
|
|
||
| this.forHtmlScript({ | ||
| left : /(<|<)%[@!=]?/g, | ||
| right : /%(>|>)/g | ||
| }); | ||
| }; | ||
|
|
||
| Brush.prototype = new SyntaxHighlighter.Highlighter(); | ||
| Brush.aliases = ['go']; | ||
|
|
||
| SyntaxHighlighter.brushes.Go = Brush; | ||
|
|
||
| // CommonJS | ||
| typeof(exports) != 'undefined' ? exports.Brush = Brush : null; | ||
| })(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add another syntax
golang.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 💯