Fix invalid syntax, leaky vars and trailing whitespace in lang JS
This commit is contained in:
Executable → Regular
+18
-19
@@ -3,40 +3,40 @@
|
||||
*
|
||||
*/
|
||||
|
||||
(function() {
|
||||
(function($) {
|
||||
|
||||
var ASCIIDoc = {
|
||||
|
||||
|
||||
'function-bold' : {
|
||||
search: /(^[\n]+)([\n\s]*)/g,
|
||||
replace: "*$1*$2"
|
||||
},
|
||||
|
||||
|
||||
'function-italic' : {
|
||||
search: /(^[\n]+)([\n\s]*)/g,
|
||||
replace: "_$1_$2"
|
||||
},
|
||||
|
||||
|
||||
'function-code' : {
|
||||
search: /(^[\n]+)([\n\s]*)/g,
|
||||
replace: "+$1+$2"
|
||||
},
|
||||
|
||||
'function-ul' : {
|
||||
|
||||
'function-ul' : {
|
||||
search: /(^[\n]+)([\n\s]*)/g,
|
||||
replace: "* $1$2"
|
||||
},
|
||||
|
||||
|
||||
'function-ol' : {
|
||||
search: /(.+)([\n]?)/g,
|
||||
replace: ". $1$2"
|
||||
},
|
||||
|
||||
|
||||
'function-blockquote' : {
|
||||
search: /(.+)([\n]?)/g,
|
||||
replace: "----\n$1$2\n----\n"
|
||||
},
|
||||
|
||||
|
||||
'function-link' : {
|
||||
exec: function( txt, selText, $field ) {
|
||||
var results = null;
|
||||
@@ -59,17 +59,17 @@ var ASCIIDoc = {
|
||||
OK: function( res ) {
|
||||
var h = '';
|
||||
if ( res['text'] && res['href'] ) {
|
||||
h = res['href'] + '[' +
|
||||
h = res['href'] + '[' +
|
||||
res['text'] + ']';
|
||||
}
|
||||
$.GollumEditor.replaceSelection( h );
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
'function-image' : {
|
||||
exec: function( txt, selText, $field ) {
|
||||
var results = null;
|
||||
@@ -98,10 +98,10 @@ var ASCIIDoc = {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
jQuery.GollumEditor.defineLanguage('asciidoc', ASCIIDoc);
|
||||
$.GollumEditor.defineLanguage('asciidoc', ASCIIDoc);
|
||||
|
||||
|
||||
var ASCIIDocHelp = [
|
||||
@@ -158,11 +158,10 @@ var ASCIIDocHelp = [
|
||||
menuName: 'Images',
|
||||
data: '<p>Images in ASCIIDoc work much like hyperlinks, but image URLs are prefixed with <code>image:</code>. For example, to link to an image at <code>images/icons/home.png</code>, write <code>image:images/icons/home.png</code>. Alt text can be added by appending the text to the URI in <code>[</code> (brackets).</p>'
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
];
|
||||
|
||||
jQuery.GollumEditor.defineHelp('asciidoc', ASCIIDocHelp);
|
||||
|
||||
})();
|
||||
$.GollumEditor.defineHelp('asciidoc', ASCIIDocHelp);
|
||||
|
||||
})(jQuery);
|
||||
|
||||
@@ -2,40 +2,40 @@
|
||||
* Creole Language Definition
|
||||
*
|
||||
*/
|
||||
(function() {
|
||||
(function($) {
|
||||
|
||||
var Creole = {
|
||||
|
||||
|
||||
'function-bold' : {
|
||||
search: /([^\n]+)([\n]*)/gi,
|
||||
replace: "**$1**$2"
|
||||
},
|
||||
|
||||
|
||||
'function-italic' : {
|
||||
search: /([^\n]+)([\n]*)/gi,
|
||||
replace: "//$1//$2"
|
||||
},
|
||||
|
||||
|
||||
'function-code' : {
|
||||
search: /([^\n]+)([\n]*)/gi,
|
||||
replace: "{{{$1}}}$2"
|
||||
},
|
||||
|
||||
|
||||
'function-hr' : {
|
||||
append: "\n\n----\n\n";
|
||||
append: "\n\n----\n\n"
|
||||
},
|
||||
|
||||
'function-ul' : {
|
||||
|
||||
'function-ul' : {
|
||||
search: /(.+)([\n]?)/gi,
|
||||
replace: "* $1$2"
|
||||
},
|
||||
|
||||
/* This looks silly but is completely valid Markdown */
|
||||
|
||||
/* This looks silly but is completely valid Markdown */
|
||||
'function-ol' : {
|
||||
search: /(.+)([\n]?)/gi,
|
||||
replace: "# $1$2"
|
||||
},
|
||||
|
||||
|
||||
'function-link' : {
|
||||
exec: function( txt, selText, $field ) {
|
||||
var results = null;
|
||||
@@ -56,16 +56,16 @@ var Creole = {
|
||||
}
|
||||
],
|
||||
OK: function( res ) {
|
||||
var h = '[[' + res['href'] + '|' +
|
||||
var h = '[[' + res['href'] + '|' +
|
||||
res['text'] + ']]';
|
||||
$.GollumEditor.replaceSelection( h );
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
'function-image' : {
|
||||
exec: function( txt, selText, $field ) {
|
||||
var results = null;
|
||||
@@ -84,8 +84,9 @@ var Creole = {
|
||||
}
|
||||
],
|
||||
OK: function( res ) {
|
||||
var h = '';
|
||||
if ( res['url'] && res['alt'] ) {
|
||||
var h = '{{' + res['url'];
|
||||
h = '{{' + res['url'];
|
||||
if ( res['alt'] != '' ) {
|
||||
h += '|' + res['alt'] + '}}';
|
||||
}
|
||||
@@ -95,9 +96,9 @@ var Creole = {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
jQuery.GollumEditor.defineLanguage('creole', Creole);
|
||||
$.GollumEditor.defineLanguage('creole', Creole);
|
||||
|
||||
})();
|
||||
})(jQuery);
|
||||
|
||||
Executable → Regular
+33
-33
@@ -1,9 +1,9 @@
|
||||
/**
|
||||
* Markdown Language Definition
|
||||
*
|
||||
* A language definition for string manipulation operations, in this case
|
||||
*
|
||||
* A language definition for string manipulation operations, in this case
|
||||
* for the Markdown, uh, markup language. Uses regexes for various functions
|
||||
* by default. If regexes won't do and you need to do some serious
|
||||
* by default. If regexes won't do and you need to do some serious
|
||||
* manipulation, you can declare a function in the object instead.
|
||||
*
|
||||
* Code example:
|
||||
@@ -14,63 +14,63 @@
|
||||
* search: /somesearchregex/gi,
|
||||
* replace: 'replace text for RegExp.replace',
|
||||
* append: "just add this where the cursor is"
|
||||
* }
|
||||
* }
|
||||
*
|
||||
**/
|
||||
(function() {
|
||||
(function($) {
|
||||
|
||||
var MarkDown = {
|
||||
|
||||
|
||||
'function-bold' : {
|
||||
search: /([^\n]+)([\n\s]*)/g,
|
||||
replace: "**$1**$2"
|
||||
},
|
||||
|
||||
|
||||
'function-italic' : {
|
||||
search: /([^\n]+)([\n\s]*)/g,
|
||||
replace: "_$1_$2"
|
||||
},
|
||||
|
||||
|
||||
'function-code' : {
|
||||
search: /(^[\n]+)([\n\s]*)/g,
|
||||
replace: "`$1`$2"
|
||||
},
|
||||
|
||||
|
||||
'function-hr' : {
|
||||
append: "\n***\n"
|
||||
},
|
||||
|
||||
'function-ul' : {
|
||||
|
||||
'function-ul' : {
|
||||
search: /(.+)([\n]?)/g,
|
||||
replace: "* $1$2"
|
||||
},
|
||||
|
||||
/* This looks silly but is completely valid Markdown */
|
||||
|
||||
/* This looks silly but is completely valid Markdown */
|
||||
'function-ol' : {
|
||||
search: /(.+)([\n]?)/g,
|
||||
replace: "1. $1$2"
|
||||
},
|
||||
|
||||
|
||||
'function-blockquote' : {
|
||||
search: /(.+)([\n]?)/g,
|
||||
replace: "> $1$2"
|
||||
},
|
||||
|
||||
},
|
||||
|
||||
'function-h1' : {
|
||||
search: /(.+)([\n]?)/g,
|
||||
replace: "# $1$2"
|
||||
},
|
||||
|
||||
|
||||
'function-h2' : {
|
||||
search: /(.+)([\n]?)/g,
|
||||
replace: "## $1$2"
|
||||
},
|
||||
|
||||
|
||||
'function-h3' : {
|
||||
search: /(.+)([\n]?)/g,
|
||||
replace: "### $1$2"
|
||||
},
|
||||
|
||||
|
||||
'function-link' : {
|
||||
exec: function( txt, selText, $field ) {
|
||||
var results = null;
|
||||
@@ -91,15 +91,15 @@ var MarkDown = {
|
||||
OK: function( res ) {
|
||||
var rep = '';
|
||||
if ( res['text'] && res['href'] ) {
|
||||
rep = '[' + res['text'] + ']('
|
||||
+ res['href'] + ')';
|
||||
rep = '[' + res['text'] + '](' +
|
||||
res['href'] + ')';
|
||||
}
|
||||
$.GollumEditor.replaceSelection( rep );
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
'function-image' : {
|
||||
exec: function( txt, selText, $field ) {
|
||||
var results = null;
|
||||
@@ -128,7 +128,7 @@ var MarkDown = {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
var MarkDownHelp = [
|
||||
@@ -162,7 +162,7 @@ var MarkDownHelp = [
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
menuName: 'Span Elements',
|
||||
content: [
|
||||
@@ -170,24 +170,24 @@ var MarkDownHelp = [
|
||||
menuName: 'Links',
|
||||
data: '<p>Markdown has two types of links: <strong>inline</strong> and <strong>reference</strong>. For both types of links, the text you want to display to the user is placed in square brackets. For example, if you want your link to display the text “GitHub”, you write <code>[GitHub]</code>.</p><p>To create an inline link, create a set of parentheses immediately after the brackets and write your URL within the parentheses. (e.g., <code>[GitHub](http://github.com/)</code>). Relative paths are allowed in inline links.</p><p>To create a reference link, use two sets of square brackets. <code>[my internal link][internal-ref]</code> will link to the internal reference <code>internal-ref</code>.</p>'
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
menuName: 'Emphasis',
|
||||
data: '<p>Asterisks (<code>*</code>) and underscores (<code>_</code>) are treated as emphasis and are wrapped with an <code><em></code> tag, which usually displays as italics in most browsers. Double asterisks (<code>**</code>) or double underscores (<code>__</code>) are treated as bold using the <code><strong></code> tag. To create italic or bold text, simply wrap your words in single/double asterisks/underscores. For example, <code>**My double emphasis text**</code> becomes <strong>My double emphasis text</strong>, and <code>*My single emphasis text*</code> becomes <em>My single emphasis text</em>.</p>'
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
menuName: 'Code',
|
||||
data: '<p>To create inline spans of code, simply wrap the code in backticks (<code>`</code>). Markdown will turn <code>`myFunction`</code> into <code>myFunction</code>.</p>'
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
menuName: 'Images',
|
||||
data: '<p>Markdown image syntax looks a lot like the syntax for links; it is essentially the same syntax preceded by an exclamation point (<code>!</code>). For example, if you want to link to an image at <code>http://github.com/unicorn.png</code> with the alternate text <code>My Unicorn</code>, you would write <code></code>.</p>'
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
menuName: 'Miscellaneous',
|
||||
content: [
|
||||
@@ -195,7 +195,7 @@ var MarkDownHelp = [
|
||||
menuName: 'Automatic Links',
|
||||
data: '<p>If you want to create a link that displays the actual URL, markdown allows you to quickly wrap the URL in <code><</code> and <code>></code> to do so. For example, the link <a href="javascript:void(0);">http://github.com/</a> is easily produced by writing <code><http://github.com/></code>.</p>'
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
menuName: 'Escaping',
|
||||
data: '<p>If you want to use a special Markdown character in your document (such as displaying literal asterisks), you can escape the character with the backslash (<code>\\</code>). Markdown will ignore the character directly after a backslash.'
|
||||
@@ -205,7 +205,7 @@ var MarkDownHelp = [
|
||||
];
|
||||
|
||||
|
||||
jQuery.GollumEditor.defineLanguage('markdown', MarkDown);
|
||||
jQuery.GollumEditor.defineHelp('markdown', MarkDownHelp);
|
||||
$.GollumEditor.defineLanguage('markdown', MarkDown);
|
||||
$.GollumEditor.defineHelp('markdown', MarkDownHelp);
|
||||
|
||||
})();
|
||||
})(jQuery);
|
||||
|
||||
@@ -1,36 +1,36 @@
|
||||
/**
|
||||
* Org-mode Language Definition
|
||||
**/
|
||||
(function() {
|
||||
(function($) {
|
||||
|
||||
var OrgMode = {
|
||||
|
||||
|
||||
'function-bold' : {
|
||||
search: /([^\n]+)([\n\s]*)/g,
|
||||
replace: "*$1*$2"
|
||||
},
|
||||
|
||||
|
||||
'function-italic' : {
|
||||
search: /([^\n]+)([\n\s]*)/g,
|
||||
replace: "/$1/$2"
|
||||
},
|
||||
|
||||
|
||||
'function-code' : {
|
||||
search: /(^[\n]+)([\n\s]*)/g,
|
||||
replace: "=$1=$2"
|
||||
},
|
||||
|
||||
'function-ul' : {
|
||||
|
||||
'function-ul' : {
|
||||
search: /(.+)([\n]?)/g,
|
||||
replace: "* $1$2"
|
||||
},
|
||||
|
||||
/* This works, just like it works for Markdown */
|
||||
|
||||
/* This works, just like it works for Markdown */
|
||||
'function-ol' : {
|
||||
search: /(.+)([\n]?)/g,
|
||||
replace: "1. $1$2"
|
||||
},
|
||||
|
||||
|
||||
'function-blockquote' : {
|
||||
search: /(.+)([\n]?)/g,
|
||||
replace: "#+BEGIN_QUOTE\n$1$2\n#+END_QUOTE\n"
|
||||
@@ -40,17 +40,17 @@ var OrgMode = {
|
||||
search: /(.+)([\n]?)/g,
|
||||
replace: "* $1$2"
|
||||
},
|
||||
|
||||
|
||||
'function-h2' : {
|
||||
search: /(.+)([\n]?)/g,
|
||||
replace: "** $1$2"
|
||||
},
|
||||
|
||||
|
||||
'function-h3' : {
|
||||
search: /(.+)([\n]?)/g,
|
||||
replace: "*** $1$2"
|
||||
},
|
||||
|
||||
|
||||
'function-link' : {
|
||||
exec: function( txt, selText, $field ) {
|
||||
var results = null;
|
||||
@@ -71,18 +71,18 @@ var OrgMode = {
|
||||
OK: function( res ) {
|
||||
var rep = '';
|
||||
if ( res['text'] && res['href'] ) {
|
||||
rep = '[[' + res['href'] + ']['
|
||||
+ res['text'] + ']]';
|
||||
rep = '[[' + res['href'] + '][' +
|
||||
res['text'] + ']]';
|
||||
}
|
||||
else if ( res['href'] ) {
|
||||
rep = '[[' + res['href'] + ']]';
|
||||
}
|
||||
$.GollumEditor.replaceSelection( rep );
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
'function-image' : {
|
||||
exec: function( txt, selText, $field ) {
|
||||
var results = null;
|
||||
@@ -93,7 +93,7 @@ var OrgMode = {
|
||||
id: 'url',
|
||||
name: 'Image URL',
|
||||
type: 'text'
|
||||
},
|
||||
}
|
||||
],
|
||||
OK: function( res ) {
|
||||
var rep = '';
|
||||
@@ -105,7 +105,7 @@ var OrgMode = {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
var OrgModeHelp = [
|
||||
@@ -136,10 +136,10 @@ var OrgModeHelp = [
|
||||
{
|
||||
menuName: 'Tables',
|
||||
data: '<p>Org-mode supports simple tables (tables with equal number of cells in each row). To create a simple table, just separate the contents of each cell with a <code>|</code> character. For example, <br><br><code>|one|two|three|<br>|four|five|six|</code><br><br> will appear as a table with two rows and three columns. Additionally, <br><br><code>|one|two|three|<br>|---+---+-----|<br>|four|five|six|</code><br><br> will also appear as a table, but the first row will be interpreted as a header row and the <code><th></code> tag will be used to render it. </p>'
|
||||
},
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
menuName: 'Span Elements',
|
||||
content: [
|
||||
@@ -147,27 +147,27 @@ var OrgModeHelp = [
|
||||
menuName: 'Links',
|
||||
data: '<p>To create links to external pages, you need to enclose the URI in double square brackets. (i.e., <code>[[http://github.com/]]</code> will automatically be parsed to <a href="javascript:void(0);">http://github.com/</a>)If you want to add text, to be displayed to the user, you write the URI and the text next to each other, both enclosed in square brackets and both of them together enclosed in another pair of square brackets. For example, if you want your link to display the text “GitHub”, you write <code>[[http://github.com][GitHub]]</code>.</p>'
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
menuName: 'Emphasis',
|
||||
data: '<p>Forward slashes (<code>/</code>) are treated as emphasis and are wrapped with an <code><i></code> tag. Asterisks (<code>*</code>) are treated as bold using the <code><b></code> tag.</p>'
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
menuName: 'Code',
|
||||
data: '<p>To create inline spans of code, simply wrap the code in equal signs (<code>=</code>). Orgmode will turn <code>=myFunction=</code> into <code>myFunction</code>.</p>'
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
menuName: 'Images',
|
||||
data: "<p>Org-mode image syntax is exactly same as the syntax that you would use for a URI to link to itself. The image URI is enclosed in double square brackets. Alt text on images is not currently supported by Gollum's Org-mode parser.</p>"
|
||||
}
|
||||
]
|
||||
},
|
||||
}
|
||||
];
|
||||
|
||||
|
||||
jQuery.GollumEditor.defineLanguage('org', OrgMode);
|
||||
jQuery.GollumEditor.defineHelp('org', OrgModeHelp);
|
||||
$.GollumEditor.defineLanguage('org', OrgMode);
|
||||
$.GollumEditor.defineHelp('org', OrgModeHelp);
|
||||
|
||||
})();
|
||||
})(jQuery);
|
||||
|
||||
Executable → Regular
+15
-15
@@ -1,40 +1,40 @@
|
||||
/**
|
||||
* Pod Language Definition
|
||||
**/
|
||||
(function() {
|
||||
(function($) {
|
||||
|
||||
var Pod = {
|
||||
|
||||
|
||||
'function-bold' : {
|
||||
search: /(^[\n]+)([\n\s]*)/g,
|
||||
replace: "B<$1>$2"
|
||||
},
|
||||
|
||||
|
||||
'function-italic' : {
|
||||
search: /(^[\n]+)([\n\s]*)/g,
|
||||
replace: "I<$1>$2"
|
||||
},
|
||||
|
||||
|
||||
'function-code' : {
|
||||
search: /(^[\n]+)([\n\s]*)/g,
|
||||
replace: "C<$1>$2"
|
||||
},
|
||||
|
||||
|
||||
'function-h1' : {
|
||||
search: /(.+)([\n]?)/gi,
|
||||
replace: "=head1 $1$2"
|
||||
},
|
||||
|
||||
|
||||
'function-h2' : {
|
||||
search: /(.+)([\n]?)/gi,
|
||||
replace: "=head2 $1$2"
|
||||
},
|
||||
|
||||
|
||||
'function-h3' : {
|
||||
search: /(.+)([\n]?)/gi,
|
||||
replace: "=head3 $1$2"
|
||||
},
|
||||
|
||||
|
||||
'function-link' : {
|
||||
exec: function( txt, selText, $field ) {
|
||||
var results = null;
|
||||
@@ -55,18 +55,18 @@ var Pod = {
|
||||
OK: function( res ) {
|
||||
var rep = '';
|
||||
if ( res['text'] && res['href'] ) {
|
||||
rep = 'L<' + res['text'] + '|'
|
||||
+ res['href'] + '>';
|
||||
rep = 'L<' + res['text'] + '|' +
|
||||
res['href'] + '>';
|
||||
}
|
||||
$.GollumEditor.replaceSelection( rep );
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
jQuery.GollumEditor.defineLanguage('pod', Pod);
|
||||
$.GollumEditor.defineLanguage('pod', Pod);
|
||||
|
||||
|
||||
var PodHelp = [
|
||||
@@ -106,6 +106,6 @@ var PodHelp = [
|
||||
}
|
||||
];
|
||||
|
||||
jQuery.GollumEditor.defineHelp('pod', PodHelp);
|
||||
$.GollumEditor.defineHelp('pod', PodHelp);
|
||||
|
||||
})();
|
||||
})(jQuery);
|
||||
|
||||
Executable → Regular
+16
-16
@@ -1,9 +1,9 @@
|
||||
/**
|
||||
* Markdown Language Definition
|
||||
*
|
||||
* A language definition for string manipulation operations, in this case
|
||||
*
|
||||
* A language definition for string manipulation operations, in this case
|
||||
* for the Markdown, uh, markup language. Uses regexes for various functions
|
||||
* by default. If regexes won't do and you need to do some serious
|
||||
* by default. If regexes won't do and you need to do some serious
|
||||
* manipulation, you can declare a function in the object instead.
|
||||
*
|
||||
* Code example:
|
||||
@@ -14,27 +14,27 @@
|
||||
* search: /somesearchregex/gi,
|
||||
* replace: 'replace text for RegExp.replace',
|
||||
* append: "just add this where the cursor is"
|
||||
* }
|
||||
* }
|
||||
*
|
||||
**/
|
||||
(function() {
|
||||
(function($) {
|
||||
|
||||
var RDoc = {
|
||||
|
||||
|
||||
'function-bold' : {
|
||||
search: /([^\n]+)([\n\s]*)/g,
|
||||
replace: "((*$1*))$2"
|
||||
}
|
||||
},
|
||||
'function-code' : {
|
||||
search: /([^\n]+)([\n\s]*)/g,
|
||||
replace: "(({$1}))$2"
|
||||
},
|
||||
|
||||
'function-ul' : {
|
||||
|
||||
'function-ul' : {
|
||||
search: /(.+)([\n]?)/gi,
|
||||
replace: "* $1$2"
|
||||
},
|
||||
|
||||
|
||||
'function-ol' : {
|
||||
exec: function( txt, selText, $field ) {
|
||||
var count = 1;
|
||||
@@ -51,24 +51,24 @@ var RDoc = {
|
||||
$.GollumEditor.replaceSelection( repText );
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
'function-h1' : {
|
||||
search: /(.+)([\n]?)/gi,
|
||||
replace: "= $1$2"
|
||||
},
|
||||
|
||||
|
||||
'function-h2' : {
|
||||
search: /(.+)([\n]?)/gi,
|
||||
replace: "== $1$2"
|
||||
},
|
||||
|
||||
|
||||
'function-h3' : {
|
||||
search: /(.+)([\n]?)/gi,
|
||||
replace: "=== $1$2"
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
jQuery.GollumEditor.defineLanguage('rdoc', RDoc);
|
||||
$.GollumEditor.defineLanguage('rdoc', RDoc);
|
||||
|
||||
})();
|
||||
})(jQuery);
|
||||
|
||||
Executable → Regular
+17
-17
@@ -1,44 +1,44 @@
|
||||
/**
|
||||
* Textile Language Definition
|
||||
*/
|
||||
(function() {
|
||||
(function($) {
|
||||
|
||||
var Textile = {
|
||||
|
||||
|
||||
'function-bold' : {
|
||||
search: /(^[\n]+)([\n\s]*)/g,
|
||||
replace: "*$1*$2"
|
||||
},
|
||||
|
||||
|
||||
'function-italic' : {
|
||||
search: /(^[\n]+)([\n\s]*)/g,
|
||||
replace: "_$1_$2"
|
||||
},
|
||||
|
||||
|
||||
'function-hr' : {
|
||||
append: "\n***\n"
|
||||
},
|
||||
|
||||
|
||||
'function-code' : {
|
||||
search: /(^[\n]+)([\n\s]*)/g,
|
||||
replace: "<pre><code>$1</code></pre>$2"
|
||||
},
|
||||
|
||||
'function-ul' : {
|
||||
|
||||
'function-ul' : {
|
||||
search: /(.+)([\n]?)/gi,
|
||||
replace: "* $1$2"
|
||||
},
|
||||
|
||||
|
||||
'function-ol' : {
|
||||
search: /(.+)([\n]?)/gi,
|
||||
replace: "# $1$2"
|
||||
},
|
||||
|
||||
|
||||
'function-blockquote' : {
|
||||
search: /(.+)([\n]?)/gi,
|
||||
replace: "bq. $1$2"
|
||||
},
|
||||
|
||||
|
||||
'function-link' : {
|
||||
exec: function( txt, selText, $field ) {
|
||||
var results = null;
|
||||
@@ -67,11 +67,11 @@ var Textile = {
|
||||
$.GollumEditor.replaceSelection( h );
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
'function-image' : {
|
||||
exec: function( txt, selText, $field ) {
|
||||
var results = null;
|
||||
@@ -102,10 +102,10 @@ var Textile = {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
jQuery.GollumEditor.defineLanguage('textile', Textile);
|
||||
$.GollumEditor.defineLanguage('textile', Textile);
|
||||
|
||||
|
||||
var TextileHelp = [
|
||||
@@ -170,6 +170,6 @@ var TextileHelp = [
|
||||
}
|
||||
];
|
||||
|
||||
jQuery.GollumEditor.defineHelp('textile', TextileHelp);
|
||||
$.GollumEditor.defineHelp('textile', TextileHelp);
|
||||
|
||||
})();
|
||||
})(jQuery);
|
||||
|
||||
Reference in New Issue
Block a user