Skip to content
This repository has been archived by the owner on Oct 18, 2021. It is now read-only.

Commit

Permalink
-Added csharp to complement c#
Browse files Browse the repository at this point in the history
-Added js to complement javascript
  • Loading branch information
danielwertheim committed Dec 3, 2011
1 parent 3d5f05e commit fdea896
Show file tree
Hide file tree
Showing 4 changed files with 92 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Source/Projects/Kiwi.Markdown/Tranformers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ protected virtual void OnInitializeTranformerRegExs()
{
const string format = @"^{0}([\s]*){1}(.*?){0}";

_cSharpCodeBlocksRegExPreTrans = new Regex(format.Apply(CodeBlockMarker, "c#"), RegexOptions.Singleline | RegexOptions.Multiline | RegexOptions.IgnoreCase | RegexOptions.Compiled);
_jsCodeBlocksRegExPreTrans = new Regex(format.Apply(CodeBlockMarker, "javascript"), RegexOptions.Singleline | RegexOptions.Multiline | RegexOptions.IgnoreCase | RegexOptions.Compiled);
_cSharpCodeBlocksRegExPreTrans = new Regex(format.Apply(CodeBlockMarker, "(c#|csharp){1}"), RegexOptions.Singleline | RegexOptions.Multiline | RegexOptions.IgnoreCase | RegexOptions.Compiled);
_jsCodeBlocksRegExPreTrans = new Regex(format.Apply(CodeBlockMarker, "(js|javascript){1}"), RegexOptions.Singleline | RegexOptions.Multiline | RegexOptions.IgnoreCase | RegexOptions.Compiled);
_htmlCodeBlocksRegExPreTrans = new Regex(format.Apply(CodeBlockMarker, "html"), RegexOptions.Singleline | RegexOptions.Multiline | RegexOptions.IgnoreCase | RegexOptions.Compiled);
_cssCodeBlocksRegExPreTrans = new Regex(format.Apply(CodeBlockMarker, "css"), RegexOptions.Singleline | RegexOptions.Multiline | RegexOptions.IgnoreCase | RegexOptions.Compiled);
_xmlCodeBlocksRegExPreTrans = new Regex(format.Apply(CodeBlockMarker, "xml"), RegexOptions.Singleline | RegexOptions.Multiline | RegexOptions.IgnoreCase | RegexOptions.Compiled);
Expand Down
5 changes: 3 additions & 2 deletions Source/SharedAssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
[assembly: AssemblyCopyright("Copyright © Daniel Wertheim")]
[assembly: AssemblyTrademark("")]

[assembly: AssemblyVersion("0.2.0")]
[assembly: AssemblyFileVersion("0.2.0")]
[assembly: AssemblyVersion("0.2.1")]
[assembly: AssemblyFileVersion("0.2.1")]


Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,55 @@ <h1>Some H1</h1>
}
</pre></div>

<div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">public</span> <span style="color:Blue;">class</span> ExplicitCSharpBlock
{
<span style="color:Blue;">public</span> <span style="color:Blue;">int</span> Value { <span style="color:Blue;">get</span>; <span style="color:Blue;">set</span>; }
}
</pre></div>

<div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">public</span> <span style="color:Blue;">class</span> ExplicitCSharpBlockWithSpace
{
<span style="color:Blue;">public</span> <span style="color:Blue;">int</span> Value { <span style="color:Blue;">get</span>; <span style="color:Blue;">set</span>; }
}
</pre></div>

<pre><code>public class ImplicitCSharpBlock
{
public int Value { get; set; }
}
</code></pre>

<div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">function</span> explicitJs(){
alert(<span style="color:#A31515;">&#39;foo&#39;</span>);
}
</pre></div>

<div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">function</span> explicitJsWithSpace(){
alert(<span style="color:#A31515;">&#39;foo&#39;</span>);
}
</pre></div>

<div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">function</span> explicitJs(){
alert(<span style="color:#A31515;">&#39;foo&#39;</span>);
}
</pre></div>

<div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">function</span> explicitJsWithSpace(){
alert(<span style="color:#A31515;">&#39;foo&#39;</span>);
}
</pre></div>

<pre><code>function implicitJs(){
alert('foo');
}
</code></pre>

<div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">&lt;</span><span style="color:#A31515;">div</span><span style="color:Blue;">&gt;</span>Some explicit html<span style="color:Blue;">&lt;/</span><span style="color:#A31515;">div</span><span style="color:Blue;">&gt;</span>
</pre></div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
# Some H1
Some text

```csharp
public class ExplicitCSharpBlock
{
public int Value { get; set; }
}
```

``` csharp
public class ExplicitCSharpBlockWithSpace
{
public int Value { get; set; }
}
```

```c#
public class ExplicitCSharpBlock
{
Expand All @@ -22,6 +36,36 @@ public class ImplicitCSharpBlock
}
```

```javascript
function explicitJs(){
alert('foo');
}
```

``` javascript
function explicitJsWithSpace(){
alert('foo');
}
```

```js
function explicitJs(){
alert('foo');
}
```

``` js
function explicitJsWithSpace(){
alert('foo');
}
```

```
function implicitJs(){
alert('foo');
}
```

```html
<div>Some explicit html</div>
```
Expand Down

0 comments on commit fdea896

Please sign in to comment.