Skip to content

Commit c87cb38

Browse files
committed
Moved MarkdownEmojis into own class and file
1 parent dd5a24a commit c87cb38

File tree

6 files changed

+40
-33
lines changed

6 files changed

+40
-33
lines changed

OneMore/Commands/File/Markdown/MarkdownConverter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ public MarkdownConverter RewriteTodo(IEnumerable<XElement> paragraphs)
218218
else
219219
{
220220
// look for all other tags
221-
foreach (var t in Page.taglist)
221+
foreach (var t in MarkdownEmojis.taglist)
222222
{
223223
// check for other tags
224224
if (text.Value.Contains(t.name))
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System.Collections.Generic;
2+
3+
namespace River.OneMoreAddIn.Commands
4+
{
5+
public static class MarkdownEmojis
6+
{
7+
public static List<(string name, string id, string topic, int type)> taglist = new List<(string name, string id, string topic, int type)>
8+
{
9+
// (":todo:", "3", "todo" , 0),
10+
(":question:", "6", "question" , 0),
11+
(":star:", "13", "important", 0 ),
12+
(":exclamation:", "17", "critical", 0),
13+
(":phone:", "18", "phone", 0),
14+
(":bulb:", "21", "idea", 0),
15+
(":house:", "23", "address", 0),
16+
(":three:", "33", "three", 0),
17+
(":zero:", "39", "zero", 0),
18+
(":two:", "51", "two", 0),
19+
(":arrow_right:", "59", "main agenda item", 0),
20+
(":one:", "70", "one", 0),
21+
(":information_desk_person:","94", "discuss person a/b", 21),
22+
(":bellsymbol:", "97", "bellsymbol", 0),
23+
(":busts_in_silhouette:", "116", "busts_in_silhouette", 0),
24+
(":bell:", "117", "bell", 0),
25+
(":letter:", "118", "letter", 0),
26+
(":musical_note:", "121", "musical_note", 0),
27+
(":secret:", "131", "idea", 0),
28+
(":book:", "132", "book", 0),
29+
(":movie_camera:", "133", "movie_camera", 0),
30+
(":zap:", "140", "lightning_bolt", 0),
31+
(":o:", "1", "default", 0)
32+
};
33+
34+
35+
}
36+
}

OneMore/Commands/File/Markdown/MarkdownWriter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ private string WriteTag(XElement element, bool contained)
438438
.Select(e => int.Parse(e.Attribute("symbol").Value))
439439
.FirstOrDefault();
440440
var retValue = "";
441-
var tagSymbol = Page.taglist.Find(x => x.id == symbol.ToString());
441+
var tagSymbol = MarkdownEmojis.taglist.Find(x => x.id == symbol.ToString());
442442
switch (symbol)
443443
{
444444
case 3: // to do

OneMore/Commands/File/Markdown/OneMoreDigExtensions.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ namespace River.OneMoreAddIn.Commands
88
using Markdig.Extensions.Emoji;
99
using System.Collections.Generic;
1010
using System.Linq;
11-
using River.OneMoreAddIn.Helpers.Office;
12-
using System.Web.UI.WebControls;
1311

1412
internal static class OneMoreDigExtensions
1513
{
@@ -21,7 +19,7 @@ public static MarkdownPipelineBuilder UseOneMoreExtensions(
2119
var emojiDicNew = new Dictionary<string, string>();
2220
foreach (var mappings in emojiDic)
2321
{
24-
var tagName = Models.Page.taglist.FirstOrDefault(x => x.name.Equals(mappings.Key)).name;
22+
var tagName = MarkdownEmojis.taglist.FirstOrDefault(x => x.name.Equals(mappings.Key)).name;
2523
if (tagName.IsNullOrEmpty())
2624
{
2725
emojiDicNew.Add(mappings.Key,mappings.Value);

OneMore/Models/Page.cs

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -121,34 +121,6 @@ public void OptimizeForSave(bool keep)
121121

122122
public bool IsValid => Root is not null;
123123

124-
public static List<(string name, string id, string topic, int type)> taglist = new List<(string name, string id, string topic, int type)>
125-
{
126-
// (":todo:", "3", "todo" , 0),
127-
(":question:", "6", "question" , 0),
128-
(":star:", "13", "important", 0 ),
129-
(":exclamation:", "17", "critical", 0),
130-
(":phone:", "18", "phone", 0),
131-
(":bulb:", "21", "idea", 0),
132-
(":house:", "23", "address", 0),
133-
(":three:", "33", "three", 0),
134-
(":zero:", "39", "zero", 0),
135-
(":two:", "51", "two", 0),
136-
(":arrow_right:", "59", "main agenda item", 0),
137-
(":one:", "70", "one", 0),
138-
(":information_desk_person:","94", "discuss person a/b", 21),
139-
(":bellsymbol:", "97", "bellsymbol", 0),
140-
(":busts_in_silhouette:", "116", "busts_in_silhouette", 0),
141-
(":bell:", "117", "bell", 0),
142-
(":letter:", "118", "letter", 0),
143-
(":musical_note:", "121", "musical_note", 0),
144-
(":secret:", "131", "idea", 0),
145-
(":book:", "132", "book", 0),
146-
(":movie_camera:", "133", "movie_camera", 0),
147-
(":zap:", "140", "lightning_bolt", 0),
148-
(":o:", "1", "default", 0)
149-
};
150-
151-
152124
/// <summary>
153125
/// Gets the namespace used to create new elements for the page
154126
/// </summary>

OneMore/OneMore.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@
147147
</Compile>
148148
<Compile Include="Commands\Edit\ConvertMarkdownCommand.cs" />
149149
<Compile Include="Commands\Edit\CopyAsTextCommand.cs" />
150+
<Compile Include="Commands\File\Markdown\MarkdownEmojis.cs" />
150151
<Compile Include="Commands\File\Markdown\WikilinkExtension.cs" />
151152
<Compile Include="Commands\File\Markdown\WikilinkParser.cs" />
152153
<Compile Include="Commands\File\Markdown\WikilinkRenderer.cs" />

0 commit comments

Comments
 (0)